{"id":22713068,"url":"https://github.com/ChuanfengLai/input-filter","last_synced_at":"2025-10-19T21:31:39.920Z","repository":{"id":58238370,"uuid":"40352140","full_name":"codelegant/input-filter","owner":"codelegant","description":"用TypeScript实现的过滤输入的jQuery插件","archived":false,"fork":false,"pushed_at":"2015-12-04T00:23:14.000Z","size":110,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-10T04:52:43.139Z","etag":null,"topics":["filter","jquery","typescript"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/codelegant.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-08-07T09:17:26.000Z","updated_at":"2020-02-17T10:41:49.000Z","dependencies_parsed_at":"2022-08-31T03:01:51.345Z","dependency_job_id":null,"html_url":"https://github.com/codelegant/input-filter","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codelegant%2Finput-filter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codelegant%2Finput-filter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codelegant%2Finput-filter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codelegant%2Finput-filter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codelegant","download_url":"https://codeload.github.com/codelegant/input-filter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237215921,"owners_count":19273554,"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":["filter","jquery","typescript"],"created_at":"2024-12-10T14:08:05.383Z","updated_at":"2025-10-19T21:31:34.613Z","avatar_url":"https://github.com/codelegant.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# input-filter\n[![GitHub release](https://img.shields.io/github/release/codelegant/input-filter.svg)](https://github.com/codelegant/input-filter/tree/1.0.0)\n[![Bower](https://img.shields.io/bower/v/input-filter.svg)](https://github.com/codelegant/input-filter/tree/1.0.0)\n[![GitHub license](https://img.shields.io/npm/v/typescript.svg?style=flat)](https://www.npmjs.com/package/typescript)\n[![jQuery Dependencies](https://img.shields.io/badge/jQuery-v1.5.0-blue.svg?style=flat)](https://github.com/codelegant/inputer-filter)\n[![GitHub license](https://img.shields.io/github/license/codelegant/input-filter.svg?style=flat)](https://github.com/codelegant/inputer-filter/blob/master/LICENSE)\n\n一款用于过滤输入的jQuery插件，使用对象必须是**输入框**，HTML标签为**input**，type类型可为 *text*，*email*，*password*，*url*，*date*等可输入值的类型。\n##浏览器支持\nIE7及以上，Chrome，Firefox，Opera\n##参数列表\n```js\n$.fn.inputFilter.options = {\n    \"type\": \"alnum\",\n    \"length\": null,\n    \"min\": 0,\n    \"max\": Infinity,\n    \"uppercase\": true,\n    \"lowercase\": true,\n    \"transform\": null,\n    \"valueChange\": function(element, value) {}\n}\n```\n##参数说明\n#### 1、type\n你想得到过滤结果的类型，参数类型：`String`，默认值：`alnum`。\u003cbr\u003e\n三个可选值：`digit`，`alpha` 与 `alnum`；\u003cbr\u003e\n`digit`：只允许输入 **正整数** ，将字母与符号屏蔽；\u003cbr\u003e \n`alpha`：只允许输入 **字母**，将数字与符号屏蔽；\u003cbr\u003e \n`alnum`：只允许输入 **正整数与字母**，将符号屏蔽。\n\n#### 2、length\n限制字符输入长度，参数类型：`Number`，默认值：`null`，`type`的值为`alpha`或者`alnum`时生效。\n\n#### 3、min\n数值的最小值，参数类型：`Number`，默认值：`0`，`type`的值为`digit`时生效。\n\n#### 4、max\n数值的最大值，参数类型：`Number`，默认值：`Infinity`，`type`的值为`digit`时生效。\n\n#### 5、uppercase\n是否允许输入大写字母，参数类型：`Boolean`，默认值：`true`，`type`的值为`alpha`与`alnum`时生效。\n\n#### 6、lowercase\n是否允许输入小写字母，参数类型：`Boolean`，默认值：`true`，`type`的值为`alpha`与`alnum`时生效。\n\n#### 7、transform\n将字符进行大小写转换，参数类型：`String`，两个可选值：`uppercase`与`lowercase`;\u003cbr\u003e\n`uppercase`，将所有字母转换为小写；`lowercase`，将所有字母转换为大写。\n\n#### 8、valueChange\n值改变事件，输入框中的值改变时触发，**IE8中则是敲击键盘时触发**，类型：`Function`，有两个参数，`element`与`value`。\u003cbr\u003e\n`element`：当前输入框，即使用插件的对象。\u003cbr/\u003e\n`value`：当前输入框的值。\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FChuanfengLai%2Finput-filter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FChuanfengLai%2Finput-filter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FChuanfengLai%2Finput-filter/lists"}