first commit
This commit is contained in:
68
public/assets/jquery/src/css/adjustCSS.js
vendored
Normal file
68
public/assets/jquery/src/css/adjustCSS.js
vendored
Normal file
@@ -0,0 +1,68 @@
|
||||
import { jQuery } from "../core.js";
|
||||
import { isAutoPx } from "./isAutoPx.js";
|
||||
import { rcssNum } from "../var/rcssNum.js";
|
||||
|
||||
export function adjustCSS( elem, prop, valueParts, tween ) {
|
||||
var adjusted, scale,
|
||||
maxIterations = 20,
|
||||
currentValue = tween ?
|
||||
function() {
|
||||
return tween.cur();
|
||||
} :
|
||||
function() {
|
||||
return jQuery.css( elem, prop, "" );
|
||||
},
|
||||
initial = currentValue(),
|
||||
unit = valueParts && valueParts[ 3 ] || ( isAutoPx( prop ) ? "px" : "" ),
|
||||
|
||||
// Starting value computation is required for potential unit mismatches
|
||||
initialInUnit = elem.nodeType &&
|
||||
( !isAutoPx( prop ) || unit !== "px" && +initial ) &&
|
||||
rcssNum.exec( jQuery.css( elem, prop ) );
|
||||
|
||||
if ( initialInUnit && initialInUnit[ 3 ] !== unit ) {
|
||||
|
||||
// Support: Firefox <=54 - 66+
|
||||
// Halve the iteration target value to prevent interference from CSS upper bounds (gh-2144)
|
||||
initial = initial / 2;
|
||||
|
||||
// Trust units reported by jQuery.css
|
||||
unit = unit || initialInUnit[ 3 ];
|
||||
|
||||
// Iteratively approximate from a nonzero starting point
|
||||
initialInUnit = +initial || 1;
|
||||
|
||||
while ( maxIterations-- ) {
|
||||
|
||||
// Evaluate and update our best guess (doubling guesses that zero out).
|
||||
// Finish if the scale equals or crosses 1 (making the old*new product non-positive).
|
||||
jQuery.style( elem, prop, initialInUnit + unit );
|
||||
if ( ( 1 - scale ) * ( 1 - ( scale = currentValue() / initial || 0.5 ) ) <= 0 ) {
|
||||
maxIterations = 0;
|
||||
}
|
||||
initialInUnit = initialInUnit / scale;
|
||||
|
||||
}
|
||||
|
||||
initialInUnit = initialInUnit * 2;
|
||||
jQuery.style( elem, prop, initialInUnit + unit );
|
||||
|
||||
// Make sure we update the tween properties later on
|
||||
valueParts = valueParts || [];
|
||||
}
|
||||
|
||||
if ( valueParts ) {
|
||||
initialInUnit = +initialInUnit || +initial || 0;
|
||||
|
||||
// Apply relative offset (+=/-=) if specified
|
||||
adjusted = valueParts[ 1 ] ?
|
||||
initialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] :
|
||||
+valueParts[ 2 ];
|
||||
if ( tween ) {
|
||||
tween.unit = unit;
|
||||
tween.start = initialInUnit;
|
||||
tween.end = adjusted;
|
||||
}
|
||||
}
|
||||
return adjusted;
|
||||
}
|
||||
12
public/assets/jquery/src/css/cssCamelCase.js
vendored
Normal file
12
public/assets/jquery/src/css/cssCamelCase.js
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
import { camelCase } from "../core/camelCase.js";
|
||||
|
||||
// Matches dashed string for camelizing
|
||||
var rmsPrefix = /^-ms-/;
|
||||
|
||||
// Convert dashed to camelCase, handle vendor prefixes.
|
||||
// Used by the css & effects modules.
|
||||
// Support: IE <=9 - 11+
|
||||
// Microsoft forgot to hump their vendor prefix (trac-9572)
|
||||
export function cssCamelCase( string ) {
|
||||
return camelCase( string.replace( rmsPrefix, "ms-" ) );
|
||||
}
|
||||
62
public/assets/jquery/src/css/curCSS.js
vendored
Normal file
62
public/assets/jquery/src/css/curCSS.js
vendored
Normal file
@@ -0,0 +1,62 @@
|
||||
import { jQuery } from "../core.js";
|
||||
import { isAttached } from "../core/isAttached.js";
|
||||
import { getStyles } from "./var/getStyles.js";
|
||||
import { rcustomProp } from "./var/rcustomProp.js";
|
||||
import { rtrimCSS } from "../var/rtrimCSS.js";
|
||||
|
||||
export function curCSS( elem, name, computed ) {
|
||||
var ret,
|
||||
isCustomProp = rcustomProp.test( name );
|
||||
|
||||
computed = computed || getStyles( elem );
|
||||
|
||||
// getPropertyValue is needed for `.css('--customProperty')` (gh-3144)
|
||||
if ( computed ) {
|
||||
|
||||
// A fallback to direct property access is needed as `computed`, being
|
||||
// the output of `getComputedStyle`, contains camelCased keys and
|
||||
// `getPropertyValue` requires kebab-case ones.
|
||||
//
|
||||
// Support: IE <=9 - 11+
|
||||
// IE only supports `"float"` in `getPropertyValue`; in computed styles
|
||||
// it's only available as `"cssFloat"`. We no longer modify properties
|
||||
// sent to `.css()` apart from camelCasing, so we need to check both.
|
||||
// Normally, this would create difference in behavior: if
|
||||
// `getPropertyValue` returns an empty string, the value returned
|
||||
// by `.css()` would be `undefined`. This is usually the case for
|
||||
// disconnected elements. However, in IE even disconnected elements
|
||||
// with no styles return `"none"` for `getPropertyValue( "float" )`
|
||||
ret = computed.getPropertyValue( name ) || computed[ name ];
|
||||
|
||||
if ( isCustomProp && ret ) {
|
||||
|
||||
// Support: Firefox 105 - 135+
|
||||
// Spec requires trimming whitespace for custom properties (gh-4926).
|
||||
// Firefox only trims leading whitespace.
|
||||
//
|
||||
// Fall back to `undefined` if empty string returned.
|
||||
// This collapses a missing definition with property defined
|
||||
// and set to an empty string but there's no standard API
|
||||
// allowing us to differentiate them without a performance penalty
|
||||
// and returning `undefined` aligns with older jQuery.
|
||||
//
|
||||
// rtrimCSS treats U+000D CARRIAGE RETURN and U+000C FORM FEED
|
||||
// as whitespace while CSS does not, but this is not a problem
|
||||
// because CSS preprocessing replaces them with U+000A LINE FEED
|
||||
// (which *is* CSS whitespace)
|
||||
// https://www.w3.org/TR/css-syntax-3/#input-preprocessing
|
||||
ret = ret.replace( rtrimCSS, "$1" ) || undefined;
|
||||
}
|
||||
|
||||
if ( ret === "" && !isAttached( elem ) ) {
|
||||
ret = jQuery.style( elem, name );
|
||||
}
|
||||
}
|
||||
|
||||
return ret !== undefined ?
|
||||
|
||||
// Support: IE <=9 - 11+
|
||||
// IE returns zIndex value as an integer.
|
||||
ret + "" :
|
||||
ret;
|
||||
}
|
||||
27
public/assets/jquery/src/css/finalPropName.js
vendored
Normal file
27
public/assets/jquery/src/css/finalPropName.js
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
import { document } from "../var/document.js";
|
||||
|
||||
var cssPrefixes = [ "Webkit", "Moz", "ms" ],
|
||||
emptyStyle = document.createElement( "div" ).style;
|
||||
|
||||
// Return a vendor-prefixed property or undefined
|
||||
function vendorPropName( name ) {
|
||||
|
||||
// Check for vendor prefixed names
|
||||
var capName = name[ 0 ].toUpperCase() + name.slice( 1 ),
|
||||
i = cssPrefixes.length;
|
||||
|
||||
while ( i-- ) {
|
||||
name = cssPrefixes[ i ] + capName;
|
||||
if ( name in emptyStyle ) {
|
||||
return name;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Return a potentially-mapped vendor prefixed property
|
||||
export function finalPropName( name ) {
|
||||
if ( name in emptyStyle ) {
|
||||
return name;
|
||||
}
|
||||
return vendorPropName( name ) || name;
|
||||
}
|
||||
10
public/assets/jquery/src/css/hiddenVisibleSelectors.js
vendored
Normal file
10
public/assets/jquery/src/css/hiddenVisibleSelectors.js
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
import { jQuery } from "../core.js";
|
||||
|
||||
import "../selector.js";
|
||||
|
||||
jQuery.expr.pseudos.hidden = function( elem ) {
|
||||
return !jQuery.expr.pseudos.visible( elem );
|
||||
};
|
||||
jQuery.expr.pseudos.visible = function( elem ) {
|
||||
return !!( elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length );
|
||||
};
|
||||
33
public/assets/jquery/src/css/isAutoPx.js
vendored
Normal file
33
public/assets/jquery/src/css/isAutoPx.js
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
var ralphaStart = /^[a-z]/,
|
||||
|
||||
// The regex visualized:
|
||||
//
|
||||
// /----------\
|
||||
// | | /-------\
|
||||
// | / Top \ | | |
|
||||
// /--- Border ---+-| Right |-+---+- Width -+---\
|
||||
// | | Bottom | |
|
||||
// | \ Left / |
|
||||
// | |
|
||||
// | /----------\ |
|
||||
// | /-------------\ | | |- END
|
||||
// | | | | / Top \ | |
|
||||
// | | / Margin \ | | | Right | | |
|
||||
// |---------+-| |-+---+-| Bottom |-+----|
|
||||
// | \ Padding / \ Left / |
|
||||
// BEGIN -| |
|
||||
// | /---------\ |
|
||||
// | | | |
|
||||
// | | / Min \ | / Width \ |
|
||||
// \--------------+-| |-+---| |---/
|
||||
// \ Max / \ Height /
|
||||
rautoPx = /^(?:Border(?:Top|Right|Bottom|Left)?(?:Width|)|(?:Margin|Padding)?(?:Top|Right|Bottom|Left)?|(?:Min|Max)?(?:Width|Height))$/;
|
||||
|
||||
export function isAutoPx( prop ) {
|
||||
|
||||
// The first test is used to ensure that:
|
||||
// 1. The prop starts with a lowercase letter (as we uppercase it for the second regex).
|
||||
// 2. The prop is not empty.
|
||||
return ralphaStart.test( prop ) &&
|
||||
rautoPx.test( prop[ 0 ].toUpperCase() + prop.slice( 1 ) );
|
||||
}
|
||||
98
public/assets/jquery/src/css/showHide.js
vendored
Normal file
98
public/assets/jquery/src/css/showHide.js
vendored
Normal file
@@ -0,0 +1,98 @@
|
||||
import { jQuery } from "../core.js";
|
||||
import { dataPriv } from "../data/var/dataPriv.js";
|
||||
import { isHiddenWithinTree } from "../css/var/isHiddenWithinTree.js";
|
||||
|
||||
var defaultDisplayMap = {};
|
||||
|
||||
function getDefaultDisplay( elem ) {
|
||||
var temp,
|
||||
doc = elem.ownerDocument,
|
||||
nodeName = elem.nodeName,
|
||||
display = defaultDisplayMap[ nodeName ];
|
||||
|
||||
if ( display ) {
|
||||
return display;
|
||||
}
|
||||
|
||||
temp = doc.body.appendChild( doc.createElement( nodeName ) );
|
||||
display = jQuery.css( temp, "display" );
|
||||
|
||||
temp.parentNode.removeChild( temp );
|
||||
|
||||
if ( display === "none" ) {
|
||||
display = "block";
|
||||
}
|
||||
defaultDisplayMap[ nodeName ] = display;
|
||||
|
||||
return display;
|
||||
}
|
||||
|
||||
export function showHide( elements, show ) {
|
||||
var display, elem,
|
||||
values = [],
|
||||
index = 0,
|
||||
length = elements.length;
|
||||
|
||||
// Determine new display value for elements that need to change
|
||||
for ( ; index < length; index++ ) {
|
||||
elem = elements[ index ];
|
||||
if ( !elem.style ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
display = elem.style.display;
|
||||
if ( show ) {
|
||||
|
||||
// Since we force visibility upon cascade-hidden elements, an immediate (and slow)
|
||||
// check is required in this first loop unless we have a nonempty display value (either
|
||||
// inline or about-to-be-restored)
|
||||
if ( display === "none" ) {
|
||||
values[ index ] = dataPriv.get( elem, "display" ) || null;
|
||||
if ( !values[ index ] ) {
|
||||
elem.style.display = "";
|
||||
}
|
||||
}
|
||||
if ( elem.style.display === "" && isHiddenWithinTree( elem ) ) {
|
||||
values[ index ] = getDefaultDisplay( elem );
|
||||
}
|
||||
} else {
|
||||
if ( display !== "none" ) {
|
||||
values[ index ] = "none";
|
||||
|
||||
// Remember what we're overwriting
|
||||
dataPriv.set( elem, "display", display );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Set the display of the elements in a second loop to avoid constant reflow
|
||||
for ( index = 0; index < length; index++ ) {
|
||||
if ( values[ index ] != null ) {
|
||||
elements[ index ].style.display = values[ index ];
|
||||
}
|
||||
}
|
||||
|
||||
return elements;
|
||||
}
|
||||
|
||||
jQuery.fn.extend( {
|
||||
show: function() {
|
||||
return showHide( this, true );
|
||||
},
|
||||
hide: function() {
|
||||
return showHide( this );
|
||||
},
|
||||
toggle: function( state ) {
|
||||
if ( typeof state === "boolean" ) {
|
||||
return state ? this.show() : this.hide();
|
||||
}
|
||||
|
||||
return this.each( function() {
|
||||
if ( isHiddenWithinTree( this ) ) {
|
||||
jQuery( this ).show();
|
||||
} else {
|
||||
jQuery( this ).hide();
|
||||
}
|
||||
} );
|
||||
}
|
||||
} );
|
||||
96
public/assets/jquery/src/css/support.js
vendored
Normal file
96
public/assets/jquery/src/css/support.js
vendored
Normal file
@@ -0,0 +1,96 @@
|
||||
import { jQuery } from "../core.js";
|
||||
import { document } from "../var/document.js";
|
||||
import { documentElement } from "../var/documentElement.js";
|
||||
import { support } from "../var/support.js";
|
||||
import { isIE } from "../var/isIE.js";
|
||||
|
||||
var reliableTrDimensionsVal, reliableColDimensionsVal,
|
||||
table = document.createElement( "table" );
|
||||
|
||||
// Executing table tests requires only one layout, so they're executed
|
||||
// at the same time to save the second computation.
|
||||
function computeTableStyleTests() {
|
||||
if (
|
||||
|
||||
// This is a singleton, we need to execute it only once
|
||||
!table ||
|
||||
|
||||
// Finish early in limited (non-browser) environments
|
||||
!table.style
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
var trStyle,
|
||||
col = document.createElement( "col" ),
|
||||
tr = document.createElement( "tr" ),
|
||||
td = document.createElement( "td" );
|
||||
|
||||
table.style.cssText = "position:absolute;left:-11111px;" +
|
||||
"border-collapse:separate;border-spacing:0";
|
||||
tr.style.cssText = "box-sizing:content-box;border:1px solid;height:1px";
|
||||
td.style.cssText = "height:9px;width:9px;padding:0";
|
||||
|
||||
col.span = 2;
|
||||
|
||||
documentElement
|
||||
.appendChild( table )
|
||||
.appendChild( col )
|
||||
.parentNode
|
||||
.appendChild( tr )
|
||||
.appendChild( td )
|
||||
.parentNode
|
||||
.appendChild( td.cloneNode( true ) );
|
||||
|
||||
// Don't run until window is visible
|
||||
if ( table.offsetWidth === 0 ) {
|
||||
documentElement.removeChild( table );
|
||||
return;
|
||||
}
|
||||
|
||||
trStyle = window.getComputedStyle( tr );
|
||||
|
||||
// Support: Firefox 135+
|
||||
// Firefox always reports computed width as if `span` was 1.
|
||||
// Support: Safari 18.3+
|
||||
// In Safari, computed width for columns is always 0.
|
||||
// In both these browsers, using `offsetWidth` solves the issue.
|
||||
// Support: IE 11+
|
||||
// In IE, `<col>` computed width is `"auto"` unless `width` is set
|
||||
// explicitly via CSS so measurements there remain incorrect. Because of
|
||||
// the lack of a proper workaround, we accept this limitation, treating
|
||||
// IE as passing the test.
|
||||
reliableColDimensionsVal = isIE || Math.round( parseFloat(
|
||||
window.getComputedStyle( col ).width )
|
||||
) === 18;
|
||||
|
||||
// Support: IE 10 - 11+
|
||||
// IE misreports `getComputedStyle` of table rows with width/height
|
||||
// set in CSS while `offset*` properties report correct values.
|
||||
// Support: Firefox 70 - 135+
|
||||
// Only Firefox includes border widths
|
||||
// in computed dimensions for table rows. (gh-4529)
|
||||
reliableTrDimensionsVal = Math.round( parseFloat( trStyle.height ) +
|
||||
parseFloat( trStyle.borderTopWidth ) +
|
||||
parseFloat( trStyle.borderBottomWidth ) ) === tr.offsetHeight;
|
||||
|
||||
documentElement.removeChild( table );
|
||||
|
||||
// Nullify the table so it wouldn't be stored in the memory;
|
||||
// it will also be a sign that checks were already performed.
|
||||
table = null;
|
||||
}
|
||||
|
||||
jQuery.extend( support, {
|
||||
reliableTrDimensions: function() {
|
||||
computeTableStyleTests();
|
||||
return reliableTrDimensionsVal;
|
||||
},
|
||||
|
||||
reliableColDimensions: function() {
|
||||
computeTableStyleTests();
|
||||
return reliableColDimensionsVal;
|
||||
}
|
||||
} );
|
||||
|
||||
export { support };
|
||||
1
public/assets/jquery/src/css/var/cssExpand.js
vendored
Normal file
1
public/assets/jquery/src/css/var/cssExpand.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export var cssExpand = [ "Top", "Right", "Bottom", "Left" ];
|
||||
15
public/assets/jquery/src/css/var/getStyles.js
vendored
Normal file
15
public/assets/jquery/src/css/var/getStyles.js
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
export function getStyles( elem ) {
|
||||
|
||||
// Support: IE <=11+ (trac-14150)
|
||||
// In IE popup's `window` is the opener window which makes `window.getComputedStyle( elem )`
|
||||
// break. Using `elem.ownerDocument.defaultView` avoids the issue.
|
||||
var view = elem.ownerDocument.defaultView;
|
||||
|
||||
// `document.implementation.createHTMLDocument( "" )` has a `null` `defaultView`
|
||||
// property; check `defaultView` truthiness to fallback to window in such a case.
|
||||
if ( !view ) {
|
||||
view = window;
|
||||
}
|
||||
|
||||
return view.getComputedStyle( elem );
|
||||
}
|
||||
20
public/assets/jquery/src/css/var/isHiddenWithinTree.js
vendored
Normal file
20
public/assets/jquery/src/css/var/isHiddenWithinTree.js
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
import { jQuery } from "../../core.js";
|
||||
|
||||
// isHiddenWithinTree reports if an element has a non-"none" display style (inline and/or
|
||||
// through the CSS cascade), which is useful in deciding whether or not to make it visible.
|
||||
// It differs from the :hidden selector (jQuery.expr.pseudos.hidden) in two important ways:
|
||||
// * A hidden ancestor does not force an element to be classified as hidden.
|
||||
// * Being disconnected from the document does not force an element to be classified as hidden.
|
||||
// These differences improve the behavior of .toggle() et al. when applied to elements that are
|
||||
// detached or contained within hidden ancestors (gh-2404, gh-2863).
|
||||
export function isHiddenWithinTree( elem, el ) {
|
||||
|
||||
// isHiddenWithinTree might be called from jQuery#filter function;
|
||||
// in that case, element will be second argument
|
||||
elem = el || elem;
|
||||
|
||||
// Inline style trumps all
|
||||
return elem.style.display === "none" ||
|
||||
elem.style.display === "" &&
|
||||
jQuery.css( elem, "display" ) === "none";
|
||||
}
|
||||
1
public/assets/jquery/src/css/var/rcustomProp.js
vendored
Normal file
1
public/assets/jquery/src/css/var/rcustomProp.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export var rcustomProp = /^--/;
|
||||
3
public/assets/jquery/src/css/var/rnumnonpx.js
vendored
Normal file
3
public/assets/jquery/src/css/var/rnumnonpx.js
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import { pnum } from "../../var/pnum.js";
|
||||
|
||||
export var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" );
|
||||
20
public/assets/jquery/src/css/var/swap.js
vendored
Normal file
20
public/assets/jquery/src/css/var/swap.js
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
// A method for quickly swapping in/out CSS properties to get correct calculations.
|
||||
export function swap( elem, options, callback ) {
|
||||
var ret, name,
|
||||
old = {};
|
||||
|
||||
// Remember the old values, and insert the new ones
|
||||
for ( name in options ) {
|
||||
old[ name ] = elem.style[ name ];
|
||||
elem.style[ name ] = options[ name ];
|
||||
}
|
||||
|
||||
ret = callback.call( elem );
|
||||
|
||||
// Revert the old values
|
||||
for ( name in options ) {
|
||||
elem.style[ name ] = old[ name ];
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
Reference in New Issue
Block a user