Skip to content

Commit f4181cf

Browse files
author
Daniel Hobi
committed
[@types/jquery.validation] Adding customElements to ValidationOptions which has been added in jquery.validation 1.21.0
1 parent 414f1e1 commit f4181cf

3 files changed

Lines changed: 11 additions & 1 deletion

File tree

types/jquery.validation/index.d.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,13 @@ declare namespace JQueryValidation {
1717
* default: false
1818
*/
1919
debug?: boolean | undefined;
20+
/**
21+
* Use this to register additional elements to be validatable. Main use case is for validating web components.
22+
* By default, only the following elements are supported: "input", "select", "textarea", "[contenteditable]"
23+
*
24+
* default: []
25+
*/
26+
customElements?: string[] | undefined;
2027
/**
2128
* Use this class to create error labels, to look for existing error labels and to add it to invalid elements.
2229
*

types/jquery.validation/jquery.validation-tests.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,9 @@ function test_validate() {
192192
onkeyup: () => {},
193193
onclick: elt => 2,
194194
});
195+
$(".selector").validate({
196+
customElements: ["my-custom-element"]
197+
});
195198
}
196199

197200
function test_methods() {

types/jquery.validation/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"private": true,
33
"name": "@types/jquery.validation",
4-
"version": "1.16.9999",
4+
"version": "1.17.9999",
55
"nonNpm": true,
66
"nonNpmDescription": "jquery.validation",
77
"projects": [

0 commit comments

Comments
 (0)