Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Templates][Identity] Update jquery-validation to 1.20.0 #58734

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/*!
* jQuery Validation Plugin v1.21.0
* jQuery Validation Plugin v1.20.0
*
* https://jqueryvalidation.org/
*
* Copyright (c) 2024 Jörn Zaefferer
* Copyright (c) 2023 Jörn Zaefferer
* Released under the MIT license
*/
(function( factory ) {
Expand Down Expand Up @@ -293,7 +293,6 @@ $.extend( $.validator, {
onsubmit: true,
ignore: ":hidden",
ignoreTitle: false,
customElements: [],
onfocusin: function( element ) {
this.lastActive = element;

Expand Down Expand Up @@ -441,17 +440,17 @@ $.extend( $.validator, {
settings[ eventType ].call( validator, this, event );
}
}
var focusListeners = [ ":text", "[type='password']", "[type='file']", "select", "textarea", "[type='number']", "[type='search']",
"[type='tel']", "[type='url']", "[type='email']", "[type='datetime']", "[type='date']", "[type='month']",
"[type='week']", "[type='time']", "[type='datetime-local']", "[type='range']", "[type='color']",
"[type='radio']", "[type='checkbox']", "[contenteditable]", "[type='button']" ];
var clickListeners = [ "select", "option", "[type='radio']", "[type='checkbox']" ];

$( this.currentForm )
.on( "focusin.validate focusout.validate keyup.validate", focusListeners.concat( this.settings.customElements ).join( ", " ), delegate )
.on( "focusin.validate focusout.validate keyup.validate",
":text, [type='password'], [type='file'], select, textarea, [type='number'], [type='search'], " +
"[type='tel'], [type='url'], [type='email'], [type='datetime'], [type='date'], [type='month'], " +
"[type='week'], [type='time'], [type='datetime-local'], [type='range'], [type='color'], " +
"[type='radio'], [type='checkbox'], [contenteditable], [type='button']", delegate )

// Support: Chrome, oldIE
// "select" is provided as event.target when clicking a option
.on( "click.validate", clickListeners.concat( this.settings.customElements ).join( ", " ), delegate );
.on( "click.validate", "select, option, [type='radio'], [type='checkbox']", delegate );

if ( this.settings.invalidHandler ) {
$( this.currentForm ).on( "invalid-form.validate", this.settings.invalidHandler );
Expand Down Expand Up @@ -648,12 +647,11 @@ $.extend( $.validator, {

elements: function() {
var validator = this,
rulesCache = {},
selectors = [ "input", "select", "textarea", "[contenteditable]" ];
rulesCache = {};

// Select all valid inputs inside the form (no submit or reset buttons)
return $( this.currentForm )
.find( selectors.concat( this.settings.customElements ).join( ", " ) )
.find( "input, select, textarea, [contenteditable]" )
.not( ":submit, :reset, :image, :disabled" )
.not( this.settings.ignore )
.filter( function() {
Expand Down Expand Up @@ -1503,7 +1501,7 @@ $.extend( $.validator, {

// https://jqueryvalidation.org/number-method/
number: function( value, element ) {
return this.optional( element ) || /^(?:-?\d+|-?\d{1,3}(?:,\d{3})+)?(?:-?\.\d+)?$/.test( value );
return this.optional( element ) || /^(?:-?\d+|-?\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test( value );
},

// https://jqueryvalidation.org/digits-method/
Expand Down Expand Up @@ -1614,12 +1612,11 @@ $.extend( $.validator, {

param = typeof param === "string" && { url: param } || param;
optionDataString = $.param( $.extend( { data: value }, param.data ) );
if ( previous.valid !== null && previous.old === optionDataString ) {
if ( previous.old === optionDataString ) {
return previous.valid;
}

previous.old = optionDataString;
previous.valid = null;
validator = this;
this.startRequest( element );
data = {};
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/*!
* jQuery Validation Plugin v1.21.0
* jQuery Validation Plugin v1.20.0
*
* https://jqueryvalidation.org/
*
* Copyright (c) 2024 Jörn Zaefferer
* Copyright (c) 2023 Jörn Zaefferer
* Released under the MIT license
*/
(function( factory ) {
Expand Down Expand Up @@ -293,7 +293,6 @@ $.extend( $.validator, {
onsubmit: true,
ignore: ":hidden",
ignoreTitle: false,
customElements: [],
onfocusin: function( element ) {
this.lastActive = element;

Expand Down Expand Up @@ -441,17 +440,17 @@ $.extend( $.validator, {
settings[ eventType ].call( validator, this, event );
}
}
var focusListeners = [ ":text", "[type='password']", "[type='file']", "select", "textarea", "[type='number']", "[type='search']",
"[type='tel']", "[type='url']", "[type='email']", "[type='datetime']", "[type='date']", "[type='month']",
"[type='week']", "[type='time']", "[type='datetime-local']", "[type='range']", "[type='color']",
"[type='radio']", "[type='checkbox']", "[contenteditable]", "[type='button']" ];
var clickListeners = [ "select", "option", "[type='radio']", "[type='checkbox']" ];

$( this.currentForm )
.on( "focusin.validate focusout.validate keyup.validate", focusListeners.concat( this.settings.customElements ).join( ", " ), delegate )
.on( "focusin.validate focusout.validate keyup.validate",
":text, [type='password'], [type='file'], select, textarea, [type='number'], [type='search'], " +
"[type='tel'], [type='url'], [type='email'], [type='datetime'], [type='date'], [type='month'], " +
"[type='week'], [type='time'], [type='datetime-local'], [type='range'], [type='color'], " +
"[type='radio'], [type='checkbox'], [contenteditable], [type='button']", delegate )

// Support: Chrome, oldIE
// "select" is provided as event.target when clicking a option
.on( "click.validate", clickListeners.concat( this.settings.customElements ).join( ", " ), delegate );
.on( "click.validate", "select, option, [type='radio'], [type='checkbox']", delegate );

if ( this.settings.invalidHandler ) {
$( this.currentForm ).on( "invalid-form.validate", this.settings.invalidHandler );
Expand Down Expand Up @@ -648,12 +647,11 @@ $.extend( $.validator, {

elements: function() {
var validator = this,
rulesCache = {},
selectors = [ "input", "select", "textarea", "[contenteditable]" ];
rulesCache = {};

// Select all valid inputs inside the form (no submit or reset buttons)
return $( this.currentForm )
.find( selectors.concat( this.settings.customElements ).join( ", " ) )
.find( "input, select, textarea, [contenteditable]" )
.not( ":submit, :reset, :image, :disabled" )
.not( this.settings.ignore )
.filter( function() {
Expand Down Expand Up @@ -1503,7 +1501,7 @@ $.extend( $.validator, {

// https://jqueryvalidation.org/number-method/
number: function( value, element ) {
return this.optional( element ) || /^(?:-?\d+|-?\d{1,3}(?:,\d{3})+)?(?:-?\.\d+)?$/.test( value );
return this.optional( element ) || /^(?:-?\d+|-?\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test( value );
},

// https://jqueryvalidation.org/digits-method/
Expand Down Expand Up @@ -1614,12 +1612,11 @@ $.extend( $.validator, {

param = typeof param === "string" && { url: param } || param;
optionDataString = $.param( $.extend( { data: value }, param.data ) );
if ( previous.valid !== null && previous.old === optionDataString ) {
if ( previous.old === optionDataString ) {
return previous.valid;
}

previous.old = optionDataString;
previous.valid = null;
validator = this;
this.startRequest( element );
data = {};
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/*!
* jQuery Validation Plugin v1.21.0
* jQuery Validation Plugin v1.20.0
*
* https://jqueryvalidation.org/
*
* Copyright (c) 2024 Jörn Zaefferer
* Copyright (c) 2023 Jörn Zaefferer
* Released under the MIT license
*/
(function( factory ) {
Expand Down Expand Up @@ -293,7 +293,6 @@ $.extend( $.validator, {
onsubmit: true,
ignore: ":hidden",
ignoreTitle: false,
customElements: [],
onfocusin: function( element ) {
this.lastActive = element;

Expand Down Expand Up @@ -441,17 +440,17 @@ $.extend( $.validator, {
settings[ eventType ].call( validator, this, event );
}
}
var focusListeners = [ ":text", "[type='password']", "[type='file']", "select", "textarea", "[type='number']", "[type='search']",
"[type='tel']", "[type='url']", "[type='email']", "[type='datetime']", "[type='date']", "[type='month']",
"[type='week']", "[type='time']", "[type='datetime-local']", "[type='range']", "[type='color']",
"[type='radio']", "[type='checkbox']", "[contenteditable]", "[type='button']" ];
var clickListeners = [ "select", "option", "[type='radio']", "[type='checkbox']" ];

$( this.currentForm )
.on( "focusin.validate focusout.validate keyup.validate", focusListeners.concat( this.settings.customElements ).join( ", " ), delegate )
.on( "focusin.validate focusout.validate keyup.validate",
":text, [type='password'], [type='file'], select, textarea, [type='number'], [type='search'], " +
"[type='tel'], [type='url'], [type='email'], [type='datetime'], [type='date'], [type='month'], " +
"[type='week'], [type='time'], [type='datetime-local'], [type='range'], [type='color'], " +
"[type='radio'], [type='checkbox'], [contenteditable], [type='button']", delegate )

// Support: Chrome, oldIE
// "select" is provided as event.target when clicking a option
.on( "click.validate", clickListeners.concat( this.settings.customElements ).join( ", " ), delegate );
.on( "click.validate", "select, option, [type='radio'], [type='checkbox']", delegate );

if ( this.settings.invalidHandler ) {
$( this.currentForm ).on( "invalid-form.validate", this.settings.invalidHandler );
Expand Down Expand Up @@ -648,12 +647,11 @@ $.extend( $.validator, {

elements: function() {
var validator = this,
rulesCache = {},
selectors = [ "input", "select", "textarea", "[contenteditable]" ];
rulesCache = {};

// Select all valid inputs inside the form (no submit or reset buttons)
return $( this.currentForm )
.find( selectors.concat( this.settings.customElements ).join( ", " ) )
.find( "input, select, textarea, [contenteditable]" )
.not( ":submit, :reset, :image, :disabled" )
.not( this.settings.ignore )
.filter( function() {
Expand Down Expand Up @@ -1503,7 +1501,7 @@ $.extend( $.validator, {

// https://jqueryvalidation.org/number-method/
number: function( value, element ) {
return this.optional( element ) || /^(?:-?\d+|-?\d{1,3}(?:,\d{3})+)?(?:-?\.\d+)?$/.test( value );
return this.optional( element ) || /^(?:-?\d+|-?\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test( value );
},

// https://jqueryvalidation.org/digits-method/
Expand Down Expand Up @@ -1614,12 +1612,11 @@ $.extend( $.validator, {

param = typeof param === "string" && { url: param } || param;
optionDataString = $.param( $.extend( { data: value }, param.data ) );
if ( previous.valid !== null && previous.old === optionDataString ) {
if ( previous.old === optionDataString ) {
return previous.valid;
}

previous.old = optionDataString;
previous.valid = null;
validator = this;
this.startRequest( element );
data = {};
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/*!
* jQuery Validation Plugin v1.21.0
* jQuery Validation Plugin v1.20.0
*
* https://jqueryvalidation.org/
*
* Copyright (c) 2024 Jörn Zaefferer
* Copyright (c) 2023 Jörn Zaefferer
* Released under the MIT license
*/
(function( factory ) {
Expand Down Expand Up @@ -293,7 +293,6 @@ $.extend( $.validator, {
onsubmit: true,
ignore: ":hidden",
ignoreTitle: false,
customElements: [],
onfocusin: function( element ) {
this.lastActive = element;

Expand Down Expand Up @@ -441,17 +440,17 @@ $.extend( $.validator, {
settings[ eventType ].call( validator, this, event );
}
}
var focusListeners = [ ":text", "[type='password']", "[type='file']", "select", "textarea", "[type='number']", "[type='search']",
"[type='tel']", "[type='url']", "[type='email']", "[type='datetime']", "[type='date']", "[type='month']",
"[type='week']", "[type='time']", "[type='datetime-local']", "[type='range']", "[type='color']",
"[type='radio']", "[type='checkbox']", "[contenteditable]", "[type='button']" ];
var clickListeners = [ "select", "option", "[type='radio']", "[type='checkbox']" ];

$( this.currentForm )
.on( "focusin.validate focusout.validate keyup.validate", focusListeners.concat( this.settings.customElements ).join( ", " ), delegate )
.on( "focusin.validate focusout.validate keyup.validate",
":text, [type='password'], [type='file'], select, textarea, [type='number'], [type='search'], " +
"[type='tel'], [type='url'], [type='email'], [type='datetime'], [type='date'], [type='month'], " +
"[type='week'], [type='time'], [type='datetime-local'], [type='range'], [type='color'], " +
"[type='radio'], [type='checkbox'], [contenteditable], [type='button']", delegate )

// Support: Chrome, oldIE
// "select" is provided as event.target when clicking a option
.on( "click.validate", clickListeners.concat( this.settings.customElements ).join( ", " ), delegate );
.on( "click.validate", "select, option, [type='radio'], [type='checkbox']", delegate );

if ( this.settings.invalidHandler ) {
$( this.currentForm ).on( "invalid-form.validate", this.settings.invalidHandler );
Expand Down Expand Up @@ -648,12 +647,11 @@ $.extend( $.validator, {

elements: function() {
var validator = this,
rulesCache = {},
selectors = [ "input", "select", "textarea", "[contenteditable]" ];
rulesCache = {};

// Select all valid inputs inside the form (no submit or reset buttons)
return $( this.currentForm )
.find( selectors.concat( this.settings.customElements ).join( ", " ) )
.find( "input, select, textarea, [contenteditable]" )
.not( ":submit, :reset, :image, :disabled" )
.not( this.settings.ignore )
.filter( function() {
Expand Down Expand Up @@ -1503,7 +1501,7 @@ $.extend( $.validator, {

// https://jqueryvalidation.org/number-method/
number: function( value, element ) {
return this.optional( element ) || /^(?:-?\d+|-?\d{1,3}(?:,\d{3})+)?(?:-?\.\d+)?$/.test( value );
return this.optional( element ) || /^(?:-?\d+|-?\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test( value );
},

// https://jqueryvalidation.org/digits-method/
Expand Down Expand Up @@ -1614,12 +1612,11 @@ $.extend( $.validator, {

param = typeof param === "string" && { url: param } || param;
optionDataString = $.param( $.extend( { data: value }, param.data ) );
if ( previous.valid !== null && previous.old === optionDataString ) {
if ( previous.old === optionDataString ) {
return previous.valid;
}

previous.old = optionDataString;
previous.valid = null;
validator = this;
this.startRequest( element );
data = {};
Expand Down

Large diffs are not rendered by default.

Loading