use-mask-input 3.0.6 → 3.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/README.md +13 -19
  2. package/dist/index.cjs +191 -0
  3. package/dist/index.cjs.map +1 -0
  4. package/dist/index.d.ts +34 -3
  5. package/dist/index.js +184 -1
  6. package/dist/index.js.map +1 -1
  7. package/package.json +49 -48
  8. package/src/index.tsx +3 -2
  9. package/src/types.ts +6 -0
  10. package/src/useMaskInput.ts +12 -9
  11. package/src/utils.spec.ts +14 -0
  12. package/src/utils.ts +23 -0
  13. package/src/withHookFormMask.ts +8 -17
  14. package/src/withMask.ts +5 -6
  15. package/dist/example/App.example.d.ts +0 -3
  16. package/dist/example/index.d.ts +0 -1
  17. package/dist/index.modern.js +0 -2
  18. package/dist/index.modern.js.map +0 -1
  19. package/dist/index.umd.js +0 -2
  20. package/dist/index.umd.js.map +0 -1
  21. package/dist/useMaskInput.d.ts +0 -9
  22. package/dist/withHookFormMask.d.ts +0 -16
  23. package/dist/withMask.d.ts +0 -3
  24. package/node_modules/inputmask/LICENSE.txt +0 -7
  25. package/node_modules/inputmask/README.md +0 -1279
  26. package/node_modules/inputmask/bundle.js +0 -6
  27. package/node_modules/inputmask/dist/bindings/inputmask.binding.js +0 -26
  28. package/node_modules/inputmask/dist/inputmask.es6.js +0 -5
  29. package/node_modules/inputmask/dist/inputmask.js +0 -3031
  30. package/node_modules/inputmask/dist/inputmask.min.js +0 -8
  31. package/node_modules/inputmask/dist/jquery.inputmask.js +0 -2985
  32. package/node_modules/inputmask/dist/jquery.inputmask.min.js +0 -8
  33. package/node_modules/inputmask/lib/bindings/inputmask.binding.js +0 -26
  34. package/node_modules/inputmask/lib/bindings/inputmask.es6.js +0 -5
  35. package/node_modules/inputmask/lib/canUseDOM.js +0 -7
  36. package/node_modules/inputmask/lib/defaults.js +0 -101
  37. package/node_modules/inputmask/lib/definitions.js +0 -13
  38. package/node_modules/inputmask/lib/dependencyLibs/data.js +0 -8
  39. package/node_modules/inputmask/lib/dependencyLibs/events.js +0 -199
  40. package/node_modules/inputmask/lib/dependencyLibs/extend.js +0 -58
  41. package/node_modules/inputmask/lib/dependencyLibs/inputmask.dependencyLib.jquery.js +0 -13
  42. package/node_modules/inputmask/lib/dependencyLibs/inputmask.dependencyLib.js +0 -41
  43. package/node_modules/inputmask/lib/environment.js +0 -9
  44. package/node_modules/inputmask/lib/escapeRegex.js +0 -4
  45. package/node_modules/inputmask/lib/eventhandlers.js +0 -513
  46. package/node_modules/inputmask/lib/eventruler.js +0 -124
  47. package/node_modules/inputmask/lib/extensions/inputmask.date.extensions.js +0 -588
  48. package/node_modules/inputmask/lib/extensions/inputmask.extensions.js +0 -133
  49. package/node_modules/inputmask/lib/extensions/inputmask.numeric.extensions.js +0 -631
  50. package/node_modules/inputmask/lib/global/window.js +0 -3
  51. package/node_modules/inputmask/lib/inputHandling.js +0 -252
  52. package/node_modules/inputmask/lib/inputmask.js +0 -355
  53. package/node_modules/inputmask/lib/inputmaskElement.js +0 -33
  54. package/node_modules/inputmask/lib/jquery.inputmask.js +0 -81
  55. package/node_modules/inputmask/lib/keycode.json +0 -25
  56. package/node_modules/inputmask/lib/mask-lexer.js +0 -467
  57. package/node_modules/inputmask/lib/mask.js +0 -244
  58. package/node_modules/inputmask/lib/masktoken.js +0 -13
  59. package/node_modules/inputmask/lib/polyfills/Array.includes.js +0 -48
  60. package/node_modules/inputmask/lib/polyfills/Object.getPrototypeOf.js +0 -7
  61. package/node_modules/inputmask/lib/positioning.js +0 -348
  62. package/node_modules/inputmask/lib/validation-tests.js +0 -597
  63. package/node_modules/inputmask/lib/validation.js +0 -664
  64. package/node_modules/inputmask/package.json +0 -60
  65. package/src/example/App.example.tsx +0 -68
  66. package/src/example/index.tsx +0 -5
@@ -1,60 +0,0 @@
1
- {
2
- "name": "inputmask",
3
- "version": "5.0.7",
4
- "description": "Inputmask is a javascript library which creates an input mask. Inputmask can run against vanilla javascript, jQuery and jqlite.",
5
- "main": "dist/inputmask.js",
6
- "files": [
7
- "bundle.js",
8
- "dist/",
9
- "lib/"
10
- ],
11
- "scripts": {
12
- "start": "webpack --progress --watch --config-name main --config webpack.config.js",
13
- "jquery": "webpack --progress --watch --config-name jquery --config webpack.config.js",
14
- "test": "grunt validate"
15
- },
16
- "repository": {
17
- "type": "git",
18
- "url": "https://github.com/RobinHerbots/Inputmask.git"
19
- },
20
- "keywords": [
21
- "form",
22
- "input",
23
- "inputmask",
24
- "jquery",
25
- "jquery-plugin",
26
- "mask",
27
- "plugins"
28
- ],
29
- "author": {
30
- "name": "Robin Herbots",
31
- "url": "https://github.com/RobinHerbots"
32
- },
33
- "license": "MIT",
34
- "bugs": {
35
- "url": "https://github.com/RobinHerbots/Inputmask/issues"
36
- },
37
- "homepage": "https://github.com/RobinHerbots/Inputmask",
38
- "devDependencies": {
39
- "@babel/core": "^7.16.5",
40
- "@babel/plugin-transform-modules-commonjs": "^7.16.5",
41
- "@babel/preset-env": "^7.16.5",
42
- "@babel/preset-typescript": "^7.16.5",
43
- "@robinherbots/grunt-available-tasks": "^0.6.4",
44
- "@robinherbots/grunt-nuget": "^0.3.2",
45
- "babel-loader": "^8.2.3",
46
- "grunt": "^1.4.1",
47
- "grunt-bump": "^0.8.0",
48
- "grunt-contrib-clean": "^2.0.0",
49
- "grunt-contrib-copy": "^1.0.0",
50
- "grunt-eslint": "^24.0.0",
51
- "grunt-release": "^0.14.0",
52
- "grunt-webpack": "^5.0.0",
53
- "jquery": "^3.6.0",
54
- "load-grunt-tasks": "^5.1.0",
55
- "lodash": "^4.17.21",
56
- "qunit": "^2.17.2",
57
- "webpack": "^5.65.0",
58
- "webpack-cli": "^4.9.1"
59
- }
60
- }
@@ -1,68 +0,0 @@
1
- /* eslint-disable import/no-extraneous-dependencies */
2
- /* eslint-disable no-console */
3
- /* eslint-disable @typescript-eslint/no-unused-vars */
4
- /* eslint-disable react/jsx-props-no-spreading */
5
- import React from 'react';
6
- import { useForm } from 'react-hook-form';
7
- import { Form, Field } from 'react-final-form';
8
- import { withHookFormMask, withMask } from '../index';
9
-
10
- function App() {
11
- const [lib, setLib] = React.useState<'hook-form' | 'final-form'>('hook-form');
12
- const { register, handleSubmit } = useForm();
13
-
14
- const onSubmit = (data: any) => {
15
- console.log(data);
16
- };
17
-
18
- return (
19
- <>
20
- <h3>Using simple ref</h3>
21
- <input type="text" ref={withMask(['(99) 9999 9999', '(99) 9 9999 9999'])} />
22
- <hr />
23
- <select onChange={(e) => setLib(e.target.value as any)}>
24
- <option value="hook-form">Hook Form</option>
25
- <option value="final-form">Final Form</option>
26
- </select>
27
- <hr />
28
-
29
- {lib === 'hook-form' && (
30
- <>
31
- <h3>Using react-hook-form</h3>
32
- <form onSubmit={handleSubmit(onSubmit)}>
33
- <input
34
- type="text"
35
- {...withHookFormMask(register('phone'), ['(99) 9999 9999', '(99) 9 9999 9999'])}
36
- />
37
- <button type="submit">Submit</button>
38
- </form>
39
- </>
40
- )}
41
-
42
- <hr />
43
- {lib === 'final-form' && (
44
- <Form
45
- onSubmit={onSubmit}
46
- render={({ handleSubmit: _handleSubmit }) => (
47
- <form onSubmit={_handleSubmit}>
48
- <h3>working with example react-final-form </h3>
49
- <Field
50
- name="phone"
51
- render={({ input, meta }) => (
52
- <label htmlFor="phone">
53
- Phone
54
- <input ref={withMask('9999-9999')} {...input} placeholder="Phone" />
55
- {meta.touched && meta.error && <span>{meta.error}</span>}
56
- </label>
57
- )}
58
- />
59
- <button type="submit">Submit</button>
60
- </form>
61
- )}
62
- />
63
- )}
64
- </>
65
- );
66
- }
67
-
68
- export default App;
@@ -1,5 +0,0 @@
1
- import React from 'react';
2
- import { render } from 'react-dom';
3
- import App from './App.example';
4
-
5
- render(<App />, document.getElementById('root'));