mirror of
https://github.com/jquery/jquery.git
synced 2024-11-23 02:54:22 +00:00
Core: Use named exports in src/
The `default` export is treated differently across tooling when transpiled to CommonJS - tools differ on whether `module.exports` represents the full module object or just its default export. Switch `src/` modules to named exports for tooling consistency. Fixes gh-5262 Closes gh-5292
This commit is contained in:
parent
42e50f8c21
commit
f75daab091
@ -221,7 +221,7 @@ module.exports = function( grunt ) {
|
||||
// Remove the jQuery export from the entry file, we'll use our own
|
||||
// custom wrapper.
|
||||
setOverride( inputRollupOptions.input,
|
||||
read( inputFileName ).replace( /\n*export default jQuery;\n*/, "\n" ) );
|
||||
read( inputFileName ).replace( /\n*export \{ jQuery, jQuery as \$ };\n*/, "\n" ) );
|
||||
|
||||
// Replace exports/global with a noop noConflict
|
||||
if ( excluded.includes( "exports/global" ) ) {
|
||||
|
14
src/ajax.js
14
src/ajax.js
@ -1,9 +1,9 @@
|
||||
import jQuery from "./core.js";
|
||||
import document from "./var/document.js";
|
||||
import rnothtmlwhite from "./var/rnothtmlwhite.js";
|
||||
import location from "./ajax/var/location.js";
|
||||
import nonce from "./ajax/var/nonce.js";
|
||||
import rquery from "./ajax/var/rquery.js";
|
||||
import { jQuery } from "./core.js";
|
||||
import { document } from "./var/document.js";
|
||||
import { rnothtmlwhite } from "./var/rnothtmlwhite.js";
|
||||
import { location } from "./ajax/var/location.js";
|
||||
import { nonce } from "./ajax/var/nonce.js";
|
||||
import { rquery } from "./ajax/var/rquery.js";
|
||||
|
||||
import "./core/init.js";
|
||||
import "./core/parseXML.js";
|
||||
@ -874,4 +874,4 @@ jQuery.ajaxPrefilter( function( s ) {
|
||||
}
|
||||
} );
|
||||
|
||||
export default jQuery;
|
||||
export { jQuery, jQuery as $ };
|
||||
|
@ -1,4 +1,4 @@
|
||||
import jQuery from "../core.js";
|
||||
import { jQuery } from "../core.js";
|
||||
|
||||
import "../ajax.js";
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
import jQuery from "../core.js";
|
||||
import nonce from "./var/nonce.js";
|
||||
import rquery from "./var/rquery.js";
|
||||
import { jQuery } from "../core.js";
|
||||
import { nonce } from "./var/nonce.js";
|
||||
import { rquery } from "./var/rquery.js";
|
||||
|
||||
import "../ajax.js";
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import jQuery from "../core.js";
|
||||
import stripAndCollapse from "../core/stripAndCollapse.js";
|
||||
import { jQuery } from "../core.js";
|
||||
import { stripAndCollapse } from "../core/stripAndCollapse.js";
|
||||
|
||||
import "../core/parseHTML.js";
|
||||
import "../ajax.js";
|
||||
|
@ -1,5 +1,5 @@
|
||||
import jQuery from "../core.js";
|
||||
import document from "../var/document.js";
|
||||
import { jQuery } from "../core.js";
|
||||
import { document } from "../var/document.js";
|
||||
|
||||
import "../ajax.js";
|
||||
|
||||
|
@ -1 +1 @@
|
||||
export default window.location;
|
||||
export var location = window.location;
|
||||
|
@ -1 +1 @@
|
||||
export default { guid: Date.now() };
|
||||
export var nonce = { guid: Date.now() };
|
||||
|
@ -1 +1 @@
|
||||
export default ( /\?/ );
|
||||
export var rquery = /\?/;
|
||||
|
@ -1,4 +1,4 @@
|
||||
import jQuery from "../core.js";
|
||||
import { jQuery } from "../core.js";
|
||||
|
||||
import "../ajax.js";
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import jQuery from "./core.js";
|
||||
import { jQuery } from "./core.js";
|
||||
|
||||
import "./attributes/attr.js";
|
||||
import "./attributes/prop.js";
|
||||
@ -6,4 +6,4 @@ import "./attributes/classes.js";
|
||||
import "./attributes/val.js";
|
||||
|
||||
// Return jQuery for attributes-only inclusion
|
||||
export default jQuery;
|
||||
export { jQuery, jQuery as $ };
|
||||
|
@ -1,8 +1,8 @@
|
||||
import jQuery from "../core.js";
|
||||
import access from "../core/access.js";
|
||||
import nodeName from "../core/nodeName.js";
|
||||
import rnothtmlwhite from "../var/rnothtmlwhite.js";
|
||||
import isIE from "../var/isIE.js";
|
||||
import { jQuery } from "../core.js";
|
||||
import { access } from "../core/access.js";
|
||||
import { nodeName } from "../core/nodeName.js";
|
||||
import { rnothtmlwhite } from "../var/rnothtmlwhite.js";
|
||||
import { isIE } from "../var/isIE.js";
|
||||
|
||||
import "../selector.js";
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
import jQuery from "../core.js";
|
||||
import stripAndCollapse from "../core/stripAndCollapse.js";
|
||||
import rnothtmlwhite from "../var/rnothtmlwhite.js";
|
||||
import { jQuery } from "../core.js";
|
||||
import { stripAndCollapse } from "../core/stripAndCollapse.js";
|
||||
import { rnothtmlwhite } from "../var/rnothtmlwhite.js";
|
||||
|
||||
import "../core/init.js";
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
import jQuery from "../core.js";
|
||||
import access from "../core/access.js";
|
||||
import isIE from "../var/isIE.js";
|
||||
import { jQuery } from "../core.js";
|
||||
import { access } from "../core/access.js";
|
||||
import { isIE } from "../var/isIE.js";
|
||||
|
||||
import "../selector.js";
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
import jQuery from "../core.js";
|
||||
import isIE from "../var/isIE.js";
|
||||
import stripAndCollapse from "../core/stripAndCollapse.js";
|
||||
import nodeName from "../core/nodeName.js";
|
||||
import { jQuery } from "../core.js";
|
||||
import { isIE } from "../var/isIE.js";
|
||||
import { stripAndCollapse } from "../core/stripAndCollapse.js";
|
||||
import { nodeName } from "../core/nodeName.js";
|
||||
|
||||
import "../core/init.js";
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
import jQuery from "./core.js";
|
||||
import toType from "./core/toType.js";
|
||||
import rnothtmlwhite from "./var/rnothtmlwhite.js";
|
||||
import { jQuery } from "./core.js";
|
||||
import { toType } from "./core/toType.js";
|
||||
import { rnothtmlwhite } from "./var/rnothtmlwhite.js";
|
||||
|
||||
// Convert String-formatted options into Object-formatted ones
|
||||
function createOptions( options ) {
|
||||
@ -227,4 +227,4 @@ jQuery.Callbacks = function( options ) {
|
||||
return self;
|
||||
};
|
||||
|
||||
export default jQuery;
|
||||
export { jQuery, jQuery as $ };
|
||||
|
30
src/core.js
30
src/core.js
@ -1,17 +1,17 @@
|
||||
import arr from "./var/arr.js";
|
||||
import getProto from "./var/getProto.js";
|
||||
import slice from "./var/slice.js";
|
||||
import flat from "./var/flat.js";
|
||||
import push from "./var/push.js";
|
||||
import indexOf from "./var/indexOf.js";
|
||||
import class2type from "./var/class2type.js";
|
||||
import toString from "./var/toString.js";
|
||||
import hasOwn from "./var/hasOwn.js";
|
||||
import fnToString from "./var/fnToString.js";
|
||||
import ObjectFunctionString from "./var/ObjectFunctionString.js";
|
||||
import support from "./var/support.js";
|
||||
import isArrayLike from "./core/isArrayLike.js";
|
||||
import DOMEval from "./core/DOMEval.js";
|
||||
import { arr } from "./var/arr.js";
|
||||
import { getProto } from "./var/getProto.js";
|
||||
import { slice } from "./var/slice.js";
|
||||
import { flat } from "./var/flat.js";
|
||||
import { push } from "./var/push.js";
|
||||
import { indexOf } from "./var/indexOf.js";
|
||||
import { class2type } from "./var/class2type.js";
|
||||
import { toString } from "./var/toString.js";
|
||||
import { hasOwn } from "./var/hasOwn.js";
|
||||
import { fnToString } from "./var/fnToString.js";
|
||||
import { ObjectFunctionString } from "./var/ObjectFunctionString.js";
|
||||
import { support } from "./var/support.js";
|
||||
import { isArrayLike } from "./core/isArrayLike.js";
|
||||
import { DOMEval } from "./core/DOMEval.js";
|
||||
|
||||
var version = "@VERSION",
|
||||
|
||||
@ -416,4 +416,4 @@ jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symb
|
||||
class2type[ "[object " + name + "]" ] = name.toLowerCase();
|
||||
} );
|
||||
|
||||
export default jQuery;
|
||||
export { jQuery, jQuery as $ };
|
||||
|
@ -1,4 +1,4 @@
|
||||
import document from "../var/document.js";
|
||||
import { document } from "../var/document.js";
|
||||
|
||||
var preservedScriptAttributes = {
|
||||
type: true,
|
||||
@ -7,7 +7,7 @@ var preservedScriptAttributes = {
|
||||
noModule: true
|
||||
};
|
||||
|
||||
function DOMEval( code, node, doc ) {
|
||||
export function DOMEval( code, node, doc ) {
|
||||
doc = doc || document;
|
||||
|
||||
var i,
|
||||
@ -23,5 +23,3 @@ function DOMEval( code, node, doc ) {
|
||||
}
|
||||
doc.head.appendChild( script ).parentNode.removeChild( script );
|
||||
}
|
||||
|
||||
export default DOMEval;
|
||||
|
@ -1,9 +1,9 @@
|
||||
import jQuery from "../core.js";
|
||||
import toType from "../core/toType.js";
|
||||
import { jQuery } from "../core.js";
|
||||
import { toType } from "../core/toType.js";
|
||||
|
||||
// Multifunctional method to get and set values of a collection
|
||||
// The value/s can optionally be executed if it's a function
|
||||
var access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
|
||||
export function access( elems, fn, key, value, chainable, emptyGet, raw ) {
|
||||
var i = 0,
|
||||
len = elems.length,
|
||||
bulk = key == null;
|
||||
@ -60,6 +60,4 @@ var access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
|
||||
}
|
||||
|
||||
return len ? fn( elems[ 0 ], key ) : emptyGet;
|
||||
};
|
||||
|
||||
export default access;
|
||||
}
|
||||
|
@ -7,8 +7,6 @@ function fcamelCase( _all, letter ) {
|
||||
}
|
||||
|
||||
// Convert dashed to camelCase
|
||||
function camelCase( string ) {
|
||||
export function camelCase( string ) {
|
||||
return string.replace( rdashAlpha, fcamelCase );
|
||||
}
|
||||
|
||||
export default camelCase;
|
||||
|
@ -1,8 +1,8 @@
|
||||
// Initialize a jQuery object
|
||||
import jQuery from "../core.js";
|
||||
import document from "../var/document.js";
|
||||
import rsingleTag from "./var/rsingleTag.js";
|
||||
import isObviousHtml from "./isObviousHtml.js";
|
||||
import { jQuery } from "../core.js";
|
||||
import { document } from "../var/document.js";
|
||||
import { rsingleTag } from "./var/rsingleTag.js";
|
||||
import { isObviousHtml } from "./isObviousHtml.js";
|
||||
|
||||
import "../traversing/findFilter.js";
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
import toType from "./toType.js";
|
||||
import isWindow from "../var/isWindow.js";
|
||||
import { toType } from "./toType.js";
|
||||
import { isWindow } from "../var/isWindow.js";
|
||||
|
||||
function isArrayLike( obj ) {
|
||||
export function isArrayLike( obj ) {
|
||||
|
||||
var length = !!obj && obj.length,
|
||||
type = toType( obj );
|
||||
@ -13,5 +13,3 @@ function isArrayLike( obj ) {
|
||||
return type === "array" || length === 0 ||
|
||||
typeof length === "number" && length > 0 && ( length - 1 ) in obj;
|
||||
}
|
||||
|
||||
export default isArrayLike;
|
||||
|
@ -1,5 +1,5 @@
|
||||
import jQuery from "../core.js";
|
||||
import documentElement from "../var/documentElement.js";
|
||||
import { jQuery } from "../core.js";
|
||||
import { documentElement } from "../var/documentElement.js";
|
||||
|
||||
var isAttached = function( elem ) {
|
||||
return jQuery.contains( elem.ownerDocument, elem ) ||
|
||||
@ -16,4 +16,4 @@ if ( !documentElement.getRootNode ) {
|
||||
};
|
||||
}
|
||||
|
||||
export default isAttached;
|
||||
export { isAttached };
|
||||
|
@ -1,7 +1,5 @@
|
||||
function isObviousHtml( input ) {
|
||||
export function isObviousHtml( input ) {
|
||||
return input[ 0 ] === "<" &&
|
||||
input[ input.length - 1 ] === ">" &&
|
||||
input.length >= 3;
|
||||
}
|
||||
|
||||
export default isObviousHtml;
|
||||
|
@ -1,7 +1,3 @@
|
||||
function nodeName( elem, name ) {
|
||||
|
||||
export function nodeName( elem, name ) {
|
||||
return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
|
||||
|
||||
}
|
||||
|
||||
export default nodeName;
|
||||
|
@ -1,8 +1,8 @@
|
||||
import jQuery from "../core.js";
|
||||
import document from "../var/document.js";
|
||||
import rsingleTag from "./var/rsingleTag.js";
|
||||
import buildFragment from "../manipulation/buildFragment.js";
|
||||
import isObviousHtml from "./isObviousHtml.js";
|
||||
import { jQuery } from "../core.js";
|
||||
import { document } from "../var/document.js";
|
||||
import { rsingleTag } from "./var/rsingleTag.js";
|
||||
import { buildFragment } from "../manipulation/buildFragment.js";
|
||||
import { isObviousHtml } from "./isObviousHtml.js";
|
||||
|
||||
// Argument "data" should be string of html or a TrustedHTML wrapper of obvious HTML
|
||||
// context (optional): If specified, the fragment will be created in this context,
|
||||
|
@ -1,4 +1,4 @@
|
||||
import jQuery from "../core.js";
|
||||
import { jQuery } from "../core.js";
|
||||
|
||||
// Cross-browser xml parsing
|
||||
jQuery.parseXML = function( data ) {
|
||||
|
@ -1,5 +1,5 @@
|
||||
import jQuery from "../core.js";
|
||||
import document from "../var/document.js";
|
||||
import { jQuery } from "../core.js";
|
||||
import { document } from "../var/document.js";
|
||||
|
||||
var readyCallbacks = [],
|
||||
whenReady = function( fn ) {
|
||||
|
@ -1,5 +1,5 @@
|
||||
import jQuery from "../core.js";
|
||||
import document from "../var/document.js";
|
||||
import { jQuery } from "../core.js";
|
||||
import { document } from "../var/document.js";
|
||||
|
||||
import "../core/readyException.js";
|
||||
import "../deferred.js";
|
||||
|
@ -1,4 +1,4 @@
|
||||
import jQuery from "../core.js";
|
||||
import { jQuery } from "../core.js";
|
||||
|
||||
jQuery.readyException = function( error ) {
|
||||
window.setTimeout( function() {
|
||||
|
@ -1,10 +1,8 @@
|
||||
import rnothtmlwhite from "../var/rnothtmlwhite.js";
|
||||
import { rnothtmlwhite } from "../var/rnothtmlwhite.js";
|
||||
|
||||
// Strip and collapse whitespace according to HTML spec
|
||||
// https://infra.spec.whatwg.org/#strip-and-collapse-ascii-whitespace
|
||||
function stripAndCollapse( value ) {
|
||||
export function stripAndCollapse( value ) {
|
||||
var tokens = value.match( rnothtmlwhite ) || [];
|
||||
return tokens.join( " " );
|
||||
}
|
||||
|
||||
export default stripAndCollapse;
|
||||
|
@ -1,7 +1,7 @@
|
||||
import class2type from "../var/class2type.js";
|
||||
import toString from "../var/toString.js";
|
||||
import { class2type } from "../var/class2type.js";
|
||||
import { toString } from "../var/toString.js";
|
||||
|
||||
function toType( obj ) {
|
||||
export function toType( obj ) {
|
||||
if ( obj == null ) {
|
||||
return obj + "";
|
||||
}
|
||||
@ -10,5 +10,3 @@ function toType( obj ) {
|
||||
class2type[ toString.call( obj ) ] || "object" :
|
||||
typeof obj;
|
||||
}
|
||||
|
||||
export default toType;
|
||||
|
@ -1,3 +1,3 @@
|
||||
// rsingleTag matches a string consisting of a single HTML element with no attributes
|
||||
// and captures the element's name
|
||||
export default ( /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i );
|
||||
export var rsingleTag = /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;
|
||||
|
34
src/css.js
34
src/css.js
@ -1,19 +1,19 @@
|
||||
import jQuery from "./core.js";
|
||||
import access from "./core/access.js";
|
||||
import nodeName from "./core/nodeName.js";
|
||||
import rcssNum from "./var/rcssNum.js";
|
||||
import isIE from "./var/isIE.js";
|
||||
import rnumnonpx from "./css/var/rnumnonpx.js";
|
||||
import rcustomProp from "./css/var/rcustomProp.js";
|
||||
import cssExpand from "./css/var/cssExpand.js";
|
||||
import isAutoPx from "./css/isAutoPx.js";
|
||||
import cssCamelCase from "./css/cssCamelCase.js";
|
||||
import getStyles from "./css/var/getStyles.js";
|
||||
import swap from "./css/var/swap.js";
|
||||
import curCSS from "./css/curCSS.js";
|
||||
import adjustCSS from "./css/adjustCSS.js";
|
||||
import finalPropName from "./css/finalPropName.js";
|
||||
import support from "./css/support.js";
|
||||
import { jQuery } from "./core.js";
|
||||
import { access } from "./core/access.js";
|
||||
import { nodeName } from "./core/nodeName.js";
|
||||
import { rcssNum } from "./var/rcssNum.js";
|
||||
import { isIE } from "./var/isIE.js";
|
||||
import { rnumnonpx } from "./css/var/rnumnonpx.js";
|
||||
import { rcustomProp } from "./css/var/rcustomProp.js";
|
||||
import { cssExpand } from "./css/var/cssExpand.js";
|
||||
import { isAutoPx } from "./css/isAutoPx.js";
|
||||
import { cssCamelCase } from "./css/cssCamelCase.js";
|
||||
import { getStyles } from "./css/var/getStyles.js";
|
||||
import { swap } from "./css/var/swap.js";
|
||||
import { curCSS } from "./css/curCSS.js";
|
||||
import { adjustCSS } from "./css/adjustCSS.js";
|
||||
import { finalPropName } from "./css/finalPropName.js";
|
||||
import { support } from "./css/support.js";
|
||||
|
||||
import "./core/init.js";
|
||||
import "./core/ready.js";
|
||||
@ -418,4 +418,4 @@ jQuery.fn.extend( {
|
||||
}
|
||||
} );
|
||||
|
||||
export default jQuery;
|
||||
export { jQuery, jQuery as $ };
|
||||
|
@ -1,8 +1,8 @@
|
||||
import jQuery from "../core.js";
|
||||
import isAutoPx from "./isAutoPx.js";
|
||||
import rcssNum from "../var/rcssNum.js";
|
||||
import { jQuery } from "../core.js";
|
||||
import { isAutoPx } from "./isAutoPx.js";
|
||||
import { rcssNum } from "../var/rcssNum.js";
|
||||
|
||||
function adjustCSS( elem, prop, valueParts, tween ) {
|
||||
export function adjustCSS( elem, prop, valueParts, tween ) {
|
||||
var adjusted, scale,
|
||||
maxIterations = 20,
|
||||
currentValue = tween ?
|
||||
@ -66,5 +66,3 @@ function adjustCSS( elem, prop, valueParts, tween ) {
|
||||
}
|
||||
return adjusted;
|
||||
}
|
||||
|
||||
export default adjustCSS;
|
||||
|
@ -1,4 +1,4 @@
|
||||
import camelCase from "../core/camelCase.js";
|
||||
import { camelCase } from "../core/camelCase.js";
|
||||
|
||||
// Matches dashed string for camelizing
|
||||
var rmsPrefix = /^-ms-/;
|
||||
@ -7,8 +7,6 @@ var rmsPrefix = /^-ms-/;
|
||||
// Used by the css & effects modules.
|
||||
// Support: IE <=9 - 11+
|
||||
// Microsoft forgot to hump their vendor prefix (trac-9572)
|
||||
function cssCamelCase( string ) {
|
||||
export function cssCamelCase( string ) {
|
||||
return camelCase( string.replace( rmsPrefix, "ms-" ) );
|
||||
}
|
||||
|
||||
export default cssCamelCase;
|
||||
|
@ -1,10 +1,10 @@
|
||||
import jQuery from "../core.js";
|
||||
import isAttached from "../core/isAttached.js";
|
||||
import getStyles from "./var/getStyles.js";
|
||||
import rcustomProp from "./var/rcustomProp.js";
|
||||
import rtrim from "../var/rtrim.js";
|
||||
import { jQuery } from "../core.js";
|
||||
import { isAttached } from "../core/isAttached.js";
|
||||
import { getStyles } from "./var/getStyles.js";
|
||||
import { rcustomProp } from "./var/rcustomProp.js";
|
||||
import { rtrim } from "../var/rtrim.js";
|
||||
|
||||
function curCSS( elem, name, computed ) {
|
||||
export function curCSS( elem, name, computed ) {
|
||||
var ret,
|
||||
isCustomProp = rcustomProp.test( name );
|
||||
|
||||
@ -57,5 +57,3 @@ function curCSS( elem, name, computed ) {
|
||||
ret + "" :
|
||||
ret;
|
||||
}
|
||||
|
||||
export default curCSS;
|
||||
|
@ -1,4 +1,4 @@
|
||||
import document from "../var/document.js";
|
||||
import { document } from "../var/document.js";
|
||||
|
||||
var cssPrefixes = [ "Webkit", "Moz", "ms" ],
|
||||
emptyStyle = document.createElement( "div" ).style,
|
||||
@ -20,7 +20,7 @@ function vendorPropName( name ) {
|
||||
}
|
||||
|
||||
// Return a potentially-mapped vendor prefixed property
|
||||
function finalPropName( name ) {
|
||||
export function finalPropName( name ) {
|
||||
var final = vendorProps[ name ];
|
||||
|
||||
if ( final ) {
|
||||
@ -31,5 +31,3 @@ function finalPropName( name ) {
|
||||
}
|
||||
return vendorProps[ name ] = vendorPropName( name ) || name;
|
||||
}
|
||||
|
||||
export default finalPropName;
|
||||
|
@ -1,4 +1,4 @@
|
||||
import jQuery from "../core.js";
|
||||
import { jQuery } from "../core.js";
|
||||
|
||||
import "../selector.js";
|
||||
|
||||
|
@ -23,7 +23,7 @@ var ralphaStart = /^[a-z]/,
|
||||
// \ Max / \ Height /
|
||||
rautoPx = /^(?:Border(?:Top|Right|Bottom|Left)?(?:Width|)|(?:Margin|Padding)?(?:Top|Right|Bottom|Left)?|(?:Min|Max)?(?:Width|Height))$/;
|
||||
|
||||
function isAutoPx( prop ) {
|
||||
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).
|
||||
@ -31,5 +31,3 @@ function isAutoPx( prop ) {
|
||||
return ralphaStart.test( prop ) &&
|
||||
rautoPx.test( prop[ 0 ].toUpperCase() + prop.slice( 1 ) );
|
||||
}
|
||||
|
||||
export default isAutoPx;
|
||||
|
@ -1,6 +1,6 @@
|
||||
import jQuery from "../core.js";
|
||||
import dataPriv from "../data/var/dataPriv.js";
|
||||
import isHiddenWithinTree from "../css/var/isHiddenWithinTree.js";
|
||||
import { jQuery } from "../core.js";
|
||||
import { dataPriv } from "../data/var/dataPriv.js";
|
||||
import { isHiddenWithinTree } from "../css/var/isHiddenWithinTree.js";
|
||||
|
||||
var defaultDisplayMap = {};
|
||||
|
||||
@ -27,7 +27,7 @@ function getDefaultDisplay( elem ) {
|
||||
return display;
|
||||
}
|
||||
|
||||
function showHide( elements, show ) {
|
||||
export function showHide( elements, show ) {
|
||||
var display, elem,
|
||||
values = [],
|
||||
index = 0,
|
||||
@ -96,5 +96,3 @@ jQuery.fn.extend( {
|
||||
} );
|
||||
}
|
||||
} );
|
||||
|
||||
export default showHide;
|
||||
|
@ -1,6 +1,6 @@
|
||||
import document from "../var/document.js";
|
||||
import documentElement from "../var/documentElement.js";
|
||||
import support from "../var/support.js";
|
||||
import { document } from "../var/document.js";
|
||||
import { documentElement } from "../var/documentElement.js";
|
||||
import { support } from "../var/support.js";
|
||||
|
||||
( function() {
|
||||
|
||||
@ -58,4 +58,4 @@ support.reliableTrDimensions = function() {
|
||||
};
|
||||
} )();
|
||||
|
||||
export default support;
|
||||
export { support };
|
||||
|
@ -1 +1 @@
|
||||
export default [ "Top", "Right", "Bottom", "Left" ];
|
||||
export var cssExpand = [ "Top", "Right", "Bottom", "Left" ];
|
||||
|
@ -1,4 +1,4 @@
|
||||
export default function( elem ) {
|
||||
export function getStyles( elem ) {
|
||||
|
||||
// Support: IE <=11+ (trac-14150)
|
||||
// In IE popup's `window` is the opener window which makes `window.getComputedStyle( elem )`
|
||||
|
@ -1,4 +1,4 @@
|
||||
import jQuery from "../../core.js";
|
||||
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.
|
||||
@ -7,7 +7,7 @@ import jQuery from "../../core.js";
|
||||
// * 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 default function( elem, el ) {
|
||||
export function isHiddenWithinTree( elem, el ) {
|
||||
|
||||
// isHiddenWithinTree might be called from jQuery#filter function;
|
||||
// in that case, element will be second argument
|
||||
|
@ -1 +1 @@
|
||||
export default ( /^--/ );
|
||||
export var rcustomProp = /^--/;
|
||||
|
@ -1,3 +1,3 @@
|
||||
import pnum from "../../var/pnum.js";
|
||||
import { pnum } from "../../var/pnum.js";
|
||||
|
||||
export default new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" );
|
||||
export var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" );
|
||||
|
@ -1,5 +1,5 @@
|
||||
// A method for quickly swapping in/out CSS properties to get correct calculations.
|
||||
export default function( elem, options, callback ) {
|
||||
export function swap( elem, options, callback ) {
|
||||
var ret, name,
|
||||
old = {};
|
||||
|
||||
|
12
src/data.js
12
src/data.js
@ -1,8 +1,8 @@
|
||||
import jQuery from "./core.js";
|
||||
import access from "./core/access.js";
|
||||
import camelCase from "./core/camelCase.js";
|
||||
import dataPriv from "./data/var/dataPriv.js";
|
||||
import dataUser from "./data/var/dataUser.js";
|
||||
import { jQuery } from "./core.js";
|
||||
import { access } from "./core/access.js";
|
||||
import { camelCase } from "./core/camelCase.js";
|
||||
import { dataPriv } from "./data/var/dataPriv.js";
|
||||
import { dataUser } from "./data/var/dataUser.js";
|
||||
|
||||
// Implementation Summary
|
||||
//
|
||||
@ -172,4 +172,4 @@ jQuery.fn.extend( {
|
||||
}
|
||||
} );
|
||||
|
||||
export default jQuery;
|
||||
export { jQuery, jQuery as $ };
|
||||
|
@ -1,9 +1,9 @@
|
||||
import jQuery from "../core.js";
|
||||
import camelCase from "../core/camelCase.js";
|
||||
import rnothtmlwhite from "../var/rnothtmlwhite.js";
|
||||
import acceptData from "./var/acceptData.js";
|
||||
import { jQuery } from "../core.js";
|
||||
import { camelCase } from "../core/camelCase.js";
|
||||
import { rnothtmlwhite } from "../var/rnothtmlwhite.js";
|
||||
import { acceptData } from "./var/acceptData.js";
|
||||
|
||||
function Data() {
|
||||
export function Data() {
|
||||
this.expando = jQuery.expando + Data.uid++;
|
||||
}
|
||||
|
||||
@ -153,5 +153,3 @@ Data.prototype = {
|
||||
return cache !== undefined && !jQuery.isEmptyObject( cache );
|
||||
}
|
||||
};
|
||||
|
||||
export default Data;
|
||||
|
@ -1,7 +1,7 @@
|
||||
/**
|
||||
* Determines whether an object can have data
|
||||
*/
|
||||
export default function( owner ) {
|
||||
export function acceptData( owner ) {
|
||||
|
||||
// Accepts only:
|
||||
// - Node
|
||||
|
@ -1,3 +1,3 @@
|
||||
import Data from "../Data.js";
|
||||
import { Data } from "../Data.js";
|
||||
|
||||
export default new Data();
|
||||
export var dataPriv = new Data();
|
||||
|
@ -1,3 +1,3 @@
|
||||
import Data from "../Data.js";
|
||||
import { Data } from "../Data.js";
|
||||
|
||||
export default new Data();
|
||||
export var dataUser = new Data();
|
||||
|
@ -1,5 +1,5 @@
|
||||
import jQuery from "./core.js";
|
||||
import slice from "./var/slice.js";
|
||||
import { jQuery } from "./core.js";
|
||||
import { slice } from "./var/slice.js";
|
||||
|
||||
import "./callbacks.js";
|
||||
|
||||
@ -389,4 +389,4 @@ jQuery.extend( {
|
||||
}
|
||||
} );
|
||||
|
||||
export default jQuery;
|
||||
export { jQuery, jQuery as $ };
|
||||
|
@ -1,4 +1,4 @@
|
||||
import jQuery from "../core.js";
|
||||
import { jQuery } from "../core.js";
|
||||
|
||||
import "../deferred.js";
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import jQuery from "./core.js";
|
||||
import slice from "./var/slice.js";
|
||||
import { jQuery } from "./core.js";
|
||||
import { slice } from "./var/slice.js";
|
||||
|
||||
import "./deprecated/ajax-event-alias.js";
|
||||
import "./deprecated/event.js";
|
||||
@ -42,3 +42,5 @@ jQuery.holdReady = function( hold ) {
|
||||
jQuery.ready( true );
|
||||
}
|
||||
};
|
||||
|
||||
export { jQuery, jQuery as $ };
|
||||
|
@ -1,4 +1,4 @@
|
||||
import jQuery from "../core.js";
|
||||
import { jQuery } from "../core.js";
|
||||
|
||||
import "../ajax.js";
|
||||
import "../event.js";
|
||||
|
@ -1,4 +1,4 @@
|
||||
import jQuery from "../core.js";
|
||||
import { jQuery } from "../core.js";
|
||||
|
||||
import "../event.js";
|
||||
import "../event/trigger.js";
|
||||
|
@ -1,6 +1,6 @@
|
||||
import jQuery from "./core.js";
|
||||
import access from "./core/access.js";
|
||||
import isWindow from "./var/isWindow.js";
|
||||
import { jQuery } from "./core.js";
|
||||
import { access } from "./core/access.js";
|
||||
import { isWindow } from "./var/isWindow.js";
|
||||
|
||||
import "./css.js";
|
||||
|
||||
@ -53,4 +53,4 @@ jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
|
||||
} );
|
||||
} );
|
||||
|
||||
export default jQuery;
|
||||
export { jQuery, jQuery as $ };
|
||||
|
22
src/effects.js
vendored
22
src/effects.js
vendored
@ -1,13 +1,13 @@
|
||||
import jQuery from "./core.js";
|
||||
import document from "./var/document.js";
|
||||
import rcssNum from "./var/rcssNum.js";
|
||||
import rnothtmlwhite from "./var/rnothtmlwhite.js";
|
||||
import cssExpand from "./css/var/cssExpand.js";
|
||||
import isHiddenWithinTree from "./css/var/isHiddenWithinTree.js";
|
||||
import adjustCSS from "./css/adjustCSS.js";
|
||||
import cssCamelCase from "./css/cssCamelCase.js";
|
||||
import dataPriv from "./data/var/dataPriv.js";
|
||||
import showHide from "./css/showHide.js";
|
||||
import { jQuery } from "./core.js";
|
||||
import { document } from "./var/document.js";
|
||||
import { rcssNum } from "./var/rcssNum.js";
|
||||
import { rnothtmlwhite } from "./var/rnothtmlwhite.js";
|
||||
import { cssExpand } from "./css/var/cssExpand.js";
|
||||
import { isHiddenWithinTree } from "./css/var/isHiddenWithinTree.js";
|
||||
import { adjustCSS } from "./css/adjustCSS.js";
|
||||
import { cssCamelCase } from "./css/cssCamelCase.js";
|
||||
import { dataPriv } from "./data/var/dataPriv.js";
|
||||
import { showHide } from "./css/showHide.js";
|
||||
|
||||
import "./core/init.js";
|
||||
import "./queue.js";
|
||||
@ -684,4 +684,4 @@ jQuery.fx.speeds = {
|
||||
_default: 400
|
||||
};
|
||||
|
||||
export default jQuery;
|
||||
export { jQuery, jQuery as $ };
|
||||
|
@ -1,6 +1,6 @@
|
||||
import jQuery from "../core.js";
|
||||
import isAutoPx from "../css/isAutoPx.js";
|
||||
import finalPropName from "../css/finalPropName.js";
|
||||
import { jQuery } from "../core.js";
|
||||
import { isAutoPx } from "../css/isAutoPx.js";
|
||||
import { finalPropName } from "../css/finalPropName.js";
|
||||
|
||||
import "../css.js";
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import jQuery from "../core.js";
|
||||
import { jQuery } from "../core.js";
|
||||
|
||||
import "../selector.js";
|
||||
import "../effects.js";
|
||||
|
20
src/event.js
20
src/event.js
@ -1,12 +1,12 @@
|
||||
import jQuery from "./core.js";
|
||||
import documentElement from "./var/documentElement.js";
|
||||
import rnothtmlwhite from "./var/rnothtmlwhite.js";
|
||||
import rcheckableType from "./var/rcheckableType.js";
|
||||
import slice from "./var/slice.js";
|
||||
import isIE from "./var/isIE.js";
|
||||
import acceptData from "./data/var/acceptData.js";
|
||||
import dataPriv from "./data/var/dataPriv.js";
|
||||
import nodeName from "./core/nodeName.js";
|
||||
import { jQuery } from "./core.js";
|
||||
import { documentElement } from "./var/documentElement.js";
|
||||
import { rnothtmlwhite } from "./var/rnothtmlwhite.js";
|
||||
import { rcheckableType } from "./var/rcheckableType.js";
|
||||
import { slice } from "./var/slice.js";
|
||||
import { isIE } from "./var/isIE.js";
|
||||
import { acceptData } from "./data/var/acceptData.js";
|
||||
import { dataPriv } from "./data/var/dataPriv.js";
|
||||
import { nodeName } from "./core/nodeName.js";
|
||||
|
||||
import "./core/init.js";
|
||||
import "./selector.js";
|
||||
@ -851,4 +851,4 @@ jQuery.fn.extend( {
|
||||
}
|
||||
} );
|
||||
|
||||
export default jQuery;
|
||||
export { jQuery, jQuery as $ };
|
||||
|
@ -1,9 +1,9 @@
|
||||
import jQuery from "../core.js";
|
||||
import document from "../var/document.js";
|
||||
import dataPriv from "../data/var/dataPriv.js";
|
||||
import acceptData from "../data/var/acceptData.js";
|
||||
import hasOwn from "../var/hasOwn.js";
|
||||
import isWindow from "../var/isWindow.js";
|
||||
import { jQuery } from "../core.js";
|
||||
import { document } from "../var/document.js";
|
||||
import { dataPriv } from "../data/var/dataPriv.js";
|
||||
import { acceptData } from "../data/var/acceptData.js";
|
||||
import { hasOwn } from "../var/hasOwn.js";
|
||||
import { isWindow } from "../var/isWindow.js";
|
||||
|
||||
import "../event.js";
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import jQuery from "../core.js";
|
||||
import { jQuery } from "../core.js";
|
||||
|
||||
// Register as a named AMD module, since jQuery can be concatenated with other
|
||||
// files that may use define, but not via a proper concatenation script that
|
||||
|
@ -1,4 +1,4 @@
|
||||
import jQuery from "../core.js";
|
||||
import { jQuery } from "../core.js";
|
||||
|
||||
var
|
||||
|
||||
|
4
src/jquery.js
vendored
4
src/jquery.js
vendored
@ -1,4 +1,4 @@
|
||||
import jQuery from "./core.js";
|
||||
import { jQuery } from "./core.js";
|
||||
|
||||
import "./selector.js";
|
||||
import "./traversing.js";
|
||||
@ -35,4 +35,4 @@ import "./deprecated.js";
|
||||
import "./exports/amd.js";
|
||||
import "./exports/global.js";
|
||||
|
||||
export default jQuery;
|
||||
export { jQuery, jQuery as $ };
|
||||
|
@ -1,17 +1,17 @@
|
||||
import jQuery from "./core.js";
|
||||
import isAttached from "./core/isAttached.js";
|
||||
import isIE from "./var/isIE.js";
|
||||
import push from "./var/push.js";
|
||||
import access from "./core/access.js";
|
||||
import rtagName from "./manipulation/var/rtagName.js";
|
||||
import wrapMap from "./manipulation/wrapMap.js";
|
||||
import getAll from "./manipulation/getAll.js";
|
||||
import domManip from "./manipulation/domManip.js";
|
||||
import setGlobalEval from "./manipulation/setGlobalEval.js";
|
||||
import dataPriv from "./data/var/dataPriv.js";
|
||||
import dataUser from "./data/var/dataUser.js";
|
||||
import acceptData from "./data/var/acceptData.js";
|
||||
import nodeName from "./core/nodeName.js";
|
||||
import { jQuery } from "./core.js";
|
||||
import { isAttached } from "./core/isAttached.js";
|
||||
import { isIE } from "./var/isIE.js";
|
||||
import { push } from "./var/push.js";
|
||||
import { access } from "./core/access.js";
|
||||
import { rtagName } from "./manipulation/var/rtagName.js";
|
||||
import { wrapMap } from "./manipulation/wrapMap.js";
|
||||
import { getAll } from "./manipulation/getAll.js";
|
||||
import { domManip } from "./manipulation/domManip.js";
|
||||
import { setGlobalEval } from "./manipulation/setGlobalEval.js";
|
||||
import { dataPriv } from "./data/var/dataPriv.js";
|
||||
import { dataUser } from "./data/var/dataUser.js";
|
||||
import { acceptData } from "./data/var/acceptData.js";
|
||||
import { nodeName } from "./core/nodeName.js";
|
||||
|
||||
import "./core/init.js";
|
||||
import "./traversing.js";
|
||||
@ -341,4 +341,4 @@ jQuery.each( {
|
||||
};
|
||||
} );
|
||||
|
||||
export default jQuery;
|
||||
export { jQuery, jQuery as $ };
|
||||
|
@ -1,4 +1,4 @@
|
||||
import jQuery from "../ajax.js";
|
||||
import { jQuery } from "../ajax.js";
|
||||
|
||||
jQuery._evalUrl = function( url, options, doc ) {
|
||||
return jQuery.ajax( {
|
||||
|
@ -1,17 +1,17 @@
|
||||
import jQuery from "../core.js";
|
||||
import toType from "../core/toType.js";
|
||||
import isAttached from "../core/isAttached.js";
|
||||
import arr from "../var/arr.js";
|
||||
import rtagName from "./var/rtagName.js";
|
||||
import rscriptType from "./var/rscriptType.js";
|
||||
import wrapMap from "./wrapMap.js";
|
||||
import getAll from "./getAll.js";
|
||||
import setGlobalEval from "./setGlobalEval.js";
|
||||
import isArrayLike from "../core/isArrayLike.js";
|
||||
import { jQuery } from "../core.js";
|
||||
import { toType } from "../core/toType.js";
|
||||
import { isAttached } from "../core/isAttached.js";
|
||||
import { arr } from "../var/arr.js";
|
||||
import { rtagName } from "./var/rtagName.js";
|
||||
import { rscriptType } from "./var/rscriptType.js";
|
||||
import { wrapMap } from "./wrapMap.js";
|
||||
import { getAll } from "./getAll.js";
|
||||
import { setGlobalEval } from "./setGlobalEval.js";
|
||||
import { isArrayLike } from "../core/isArrayLike.js";
|
||||
|
||||
var rhtml = /<|&#?\w+;/;
|
||||
|
||||
function buildFragment( elems, context, scripts, selection, ignored ) {
|
||||
export function buildFragment( elems, context, scripts, selection, ignored ) {
|
||||
var elem, tmp, tag, wrap, attached, j,
|
||||
fragment = context.createDocumentFragment(),
|
||||
nodes = [],
|
||||
@ -95,5 +95,3 @@ function buildFragment( elems, context, scripts, selection, ignored ) {
|
||||
|
||||
return fragment;
|
||||
}
|
||||
|
||||
export default buildFragment;
|
||||
|
@ -1,10 +1,10 @@
|
||||
import jQuery from "../core.js";
|
||||
import flat from "../var/flat.js";
|
||||
import rscriptType from "./var/rscriptType.js";
|
||||
import getAll from "./getAll.js";
|
||||
import buildFragment from "./buildFragment.js";
|
||||
import dataPriv from "../data/var/dataPriv.js";
|
||||
import DOMEval from "../core/DOMEval.js";
|
||||
import { jQuery } from "../core.js";
|
||||
import { flat } from "../var/flat.js";
|
||||
import { rscriptType } from "./var/rscriptType.js";
|
||||
import { getAll } from "./getAll.js";
|
||||
import { buildFragment } from "./buildFragment.js";
|
||||
import { dataPriv } from "../data/var/dataPriv.js";
|
||||
import { DOMEval } from "../core/DOMEval.js";
|
||||
|
||||
// Replace/restore the type attribute of script elements for safe DOM manipulation
|
||||
function disableScript( elem ) {
|
||||
@ -21,7 +21,7 @@ function restoreScript( elem ) {
|
||||
return elem;
|
||||
}
|
||||
|
||||
function domManip( collection, args, callback, ignored ) {
|
||||
export function domManip( collection, args, callback, ignored ) {
|
||||
|
||||
// Flatten any nested arrays
|
||||
args = flat( args );
|
||||
@ -105,5 +105,3 @@ function domManip( collection, args, callback, ignored ) {
|
||||
|
||||
return collection;
|
||||
}
|
||||
|
||||
export default domManip;
|
||||
|
@ -1,7 +1,7 @@
|
||||
import jQuery from "../core.js";
|
||||
import nodeName from "../core/nodeName.js";
|
||||
import { jQuery } from "../core.js";
|
||||
import { nodeName } from "../core/nodeName.js";
|
||||
|
||||
function getAll( context, tag ) {
|
||||
export function getAll( context, tag ) {
|
||||
|
||||
// Support: IE <=9 - 11+
|
||||
// Use typeof to avoid zero-argument method invocation on host objects (trac-15151)
|
||||
@ -23,5 +23,3 @@ function getAll( context, tag ) {
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
export default getAll;
|
||||
|
@ -1,7 +1,7 @@
|
||||
import dataPriv from "../data/var/dataPriv.js";
|
||||
import { dataPriv } from "../data/var/dataPriv.js";
|
||||
|
||||
// Mark scripts as having already been evaluated
|
||||
function setGlobalEval( elems, refElements ) {
|
||||
export function setGlobalEval( elems, refElements ) {
|
||||
var i = 0,
|
||||
l = elems.length;
|
||||
|
||||
@ -13,5 +13,3 @@ function setGlobalEval( elems, refElements ) {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default setGlobalEval;
|
||||
|
@ -1 +1 @@
|
||||
export default ( /^$|^module$|\/(?:java|ecma)script/i );
|
||||
export var rscriptType = /^$|^module$|\/(?:java|ecma)script/i;
|
||||
|
@ -1,4 +1,4 @@
|
||||
// rtagName captures the name from the first start tag in a string of HTML
|
||||
// https://html.spec.whatwg.org/multipage/syntax.html#tag-open-state
|
||||
// https://html.spec.whatwg.org/multipage/syntax.html#tag-name-state
|
||||
export default ( /<([a-z][^\/\0>\x20\t\r\n\f]*)/i );
|
||||
export var rtagName = /<([a-z][^\/\0>\x20\t\r\n\f]*)/i;
|
||||
|
@ -1,4 +1,4 @@
|
||||
var wrapMap = {
|
||||
export var wrapMap = {
|
||||
|
||||
// Table parts need to be wrapped with `<table>` or they're
|
||||
// stripped to their contents when put in a div.
|
||||
@ -13,5 +13,3 @@ var wrapMap = {
|
||||
|
||||
wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
|
||||
wrapMap.th = wrapMap.td;
|
||||
|
||||
export default wrapMap;
|
||||
|
@ -1,7 +1,7 @@
|
||||
import jQuery from "./core.js";
|
||||
import access from "./core/access.js";
|
||||
import documentElement from "./var/documentElement.js";
|
||||
import isWindow from "./var/isWindow.js";
|
||||
import { jQuery } from "./core.js";
|
||||
import { access } from "./core/access.js";
|
||||
import { documentElement } from "./var/documentElement.js";
|
||||
import { isWindow } from "./var/isWindow.js";
|
||||
|
||||
import "./core/init.js";
|
||||
import "./css.js";
|
||||
@ -198,4 +198,4 @@ jQuery.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function(
|
||||
};
|
||||
} );
|
||||
|
||||
export default jQuery;
|
||||
export { jQuery, jQuery as $ };
|
||||
|
@ -1,5 +1,5 @@
|
||||
import jQuery from "./core.js";
|
||||
import dataPriv from "./data/var/dataPriv.js";
|
||||
import { jQuery } from "./core.js";
|
||||
import { dataPriv } from "./data/var/dataPriv.js";
|
||||
|
||||
import "./deferred.js";
|
||||
import "./callbacks.js";
|
||||
@ -138,4 +138,4 @@ jQuery.fn.extend( {
|
||||
}
|
||||
} );
|
||||
|
||||
export default jQuery;
|
||||
export { jQuery, jQuery as $ };
|
||||
|
@ -1,4 +1,4 @@
|
||||
import jQuery from "../core.js";
|
||||
import { jQuery } from "../core.js";
|
||||
|
||||
import "../queue.js";
|
||||
import "../effects.js"; // Delay is optional because of this dependency
|
||||
|
@ -21,20 +21,20 @@
|
||||
* needs.
|
||||
*/
|
||||
|
||||
import jQuery from "./core.js";
|
||||
import document from "./var/document.js";
|
||||
import whitespace from "./var/whitespace.js";
|
||||
import isIE from "./var/isIE.js";
|
||||
import booleans from "./selector/var/booleans.js";
|
||||
import rleadingCombinator from "./selector/var/rleadingCombinator.js";
|
||||
import rdescend from "./selector/var/rdescend.js";
|
||||
import rsibling from "./selector/var/rsibling.js";
|
||||
import matches from "./selector/var/matches.js";
|
||||
import testContext from "./selector/testContext.js";
|
||||
import filterMatchExpr from "./selector/filterMatchExpr.js";
|
||||
import preFilter from "./selector/preFilter.js";
|
||||
import tokenize from "./selector/tokenize.js";
|
||||
import toSelector from "./selector/toSelector.js";
|
||||
import { jQuery } from "./core.js";
|
||||
import { document } from "./var/document.js";
|
||||
import { whitespace } from "./var/whitespace.js";
|
||||
import { isIE } from "./var/isIE.js";
|
||||
import { booleans } from "./selector/var/booleans.js";
|
||||
import { rleadingCombinator } from "./selector/var/rleadingCombinator.js";
|
||||
import { rdescend } from "./selector/var/rdescend.js";
|
||||
import { rsibling } from "./selector/var/rsibling.js";
|
||||
import { matches } from "./selector/var/matches.js";
|
||||
import { testContext } from "./selector/testContext.js";
|
||||
import { filterMatchExpr } from "./selector/filterMatchExpr.js";
|
||||
import { preFilter } from "./selector/preFilter.js";
|
||||
import { tokenize } from "./selector/tokenize.js";
|
||||
import { toSelector } from "./selector/toSelector.js";
|
||||
|
||||
// The following utils are attached directly to the jQuery object.
|
||||
import "./selector/escapeSelector.js";
|
||||
@ -145,3 +145,5 @@ jQuery.extend( jQuery.find, {
|
||||
},
|
||||
tokenize: tokenize
|
||||
} );
|
||||
|
||||
export { jQuery, jQuery as $ };
|
||||
|
@ -1,27 +1,27 @@
|
||||
import jQuery from "./core.js";
|
||||
import nodeName from "./core/nodeName.js";
|
||||
import document from "./var/document.js";
|
||||
import indexOf from "./var/indexOf.js";
|
||||
import pop from "./var/pop.js";
|
||||
import push from "./var/push.js";
|
||||
import whitespace from "./var/whitespace.js";
|
||||
import rbuggyQSA from "./selector/rbuggyQSA.js";
|
||||
import rtrim from "./var/rtrim.js";
|
||||
import isIE from "./var/isIE.js";
|
||||
import identifier from "./selector/var/identifier.js";
|
||||
import booleans from "./selector/var/booleans.js";
|
||||
import rleadingCombinator from "./selector/var/rleadingCombinator.js";
|
||||
import rdescend from "./selector/var/rdescend.js";
|
||||
import rsibling from "./selector/var/rsibling.js";
|
||||
import matches from "./selector/var/matches.js";
|
||||
import createCache from "./selector/createCache.js";
|
||||
import testContext from "./selector/testContext.js";
|
||||
import filterMatchExpr from "./selector/filterMatchExpr.js";
|
||||
import preFilter from "./selector/preFilter.js";
|
||||
import selectorError from "./selector/selectorError.js";
|
||||
import unescapeSelector from "./selector/unescapeSelector.js";
|
||||
import tokenize from "./selector/tokenize.js";
|
||||
import toSelector from "./selector/toSelector.js";
|
||||
import { jQuery } from "./core.js";
|
||||
import { nodeName } from "./core/nodeName.js";
|
||||
import { document } from "./var/document.js";
|
||||
import { indexOf } from "./var/indexOf.js";
|
||||
import { pop } from "./var/pop.js";
|
||||
import { push } from "./var/push.js";
|
||||
import { whitespace } from "./var/whitespace.js";
|
||||
import { rbuggyQSA } from "./selector/rbuggyQSA.js";
|
||||
import { rtrim } from "./var/rtrim.js";
|
||||
import { isIE } from "./var/isIE.js";
|
||||
import { identifier } from "./selector/var/identifier.js";
|
||||
import { booleans } from "./selector/var/booleans.js";
|
||||
import { rleadingCombinator } from "./selector/var/rleadingCombinator.js";
|
||||
import { rdescend } from "./selector/var/rdescend.js";
|
||||
import { rsibling } from "./selector/var/rsibling.js";
|
||||
import { matches } from "./selector/var/matches.js";
|
||||
import { createCache } from "./selector/createCache.js";
|
||||
import { testContext } from "./selector/testContext.js";
|
||||
import { filterMatchExpr } from "./selector/filterMatchExpr.js";
|
||||
import { preFilter } from "./selector/preFilter.js";
|
||||
import { selectorError } from "./selector/selectorError.js";
|
||||
import { unescapeSelector } from "./selector/unescapeSelector.js";
|
||||
import { tokenize } from "./selector/tokenize.js";
|
||||
import { toSelector } from "./selector/toSelector.js";
|
||||
|
||||
// The following utils are attached directly to the jQuery object.
|
||||
import "./selector/escapeSelector.js";
|
||||
@ -1370,3 +1370,5 @@ find.setDocument = setDocument;
|
||||
find.tokenize = tokenize;
|
||||
|
||||
} )();
|
||||
|
||||
export { jQuery, jQuery as $ };
|
||||
|
@ -1,4 +1,4 @@
|
||||
import jQuery from "../core.js";
|
||||
import { jQuery } from "../core.js";
|
||||
|
||||
/**
|
||||
* Create key-value caches of limited size
|
||||
@ -6,7 +6,7 @@ import jQuery from "../core.js";
|
||||
* property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)
|
||||
* deleting the oldest entry
|
||||
*/
|
||||
function createCache() {
|
||||
export function createCache() {
|
||||
var keys = [];
|
||||
|
||||
function cache( key, value ) {
|
||||
@ -22,5 +22,3 @@ function createCache() {
|
||||
}
|
||||
return cache;
|
||||
}
|
||||
|
||||
export default createCache;
|
||||
|
@ -1,4 +1,4 @@
|
||||
import jQuery from "../core.js";
|
||||
import { jQuery } from "../core.js";
|
||||
|
||||
// CSS string/identifier serialization
|
||||
// https://drafts.csswg.org/cssom/#common-serializing-idioms
|
||||
|
@ -1,9 +1,9 @@
|
||||
import whitespace from "../var/whitespace.js";
|
||||
import identifier from "./var/identifier.js";
|
||||
import attributes from "./var/attributes.js";
|
||||
import pseudos from "./var/pseudos.js";
|
||||
import { whitespace } from "../var/whitespace.js";
|
||||
import { identifier } from "./var/identifier.js";
|
||||
import { attributes } from "./var/attributes.js";
|
||||
import { pseudos } from "./var/pseudos.js";
|
||||
|
||||
var filterMatchExpr = {
|
||||
export var filterMatchExpr = {
|
||||
ID: new RegExp( "^#(" + identifier + ")" ),
|
||||
CLASS: new RegExp( "^\\.(" + identifier + ")" ),
|
||||
TAG: new RegExp( "^(" + identifier + "|[*])" ),
|
||||
@ -14,5 +14,3 @@ var filterMatchExpr = {
|
||||
whitespace + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" +
|
||||
whitespace + "*(\\d+)|))" + whitespace + "*\\)|)", "i" )
|
||||
};
|
||||
|
||||
export default filterMatchExpr;
|
||||
|
@ -1,10 +1,10 @@
|
||||
import rpseudo from "./var/rpseudo.js";
|
||||
import filterMatchExpr from "./filterMatchExpr.js";
|
||||
import unescapeSelector from "./unescapeSelector.js";
|
||||
import selectorError from "./selectorError.js";
|
||||
import tokenize from "./tokenize.js";
|
||||
import { rpseudo } from "./var/rpseudo.js";
|
||||
import { filterMatchExpr } from "./filterMatchExpr.js";
|
||||
import { unescapeSelector } from "./unescapeSelector.js";
|
||||
import { selectorError } from "./selectorError.js";
|
||||
import { tokenize } from "./tokenize.js";
|
||||
|
||||
var preFilter = {
|
||||
export var preFilter = {
|
||||
ATTR: function( match ) {
|
||||
match[ 1 ] = unescapeSelector( match[ 1 ] );
|
||||
|
||||
@ -86,5 +86,3 @@ var preFilter = {
|
||||
return match.slice( 0, 3 );
|
||||
}
|
||||
};
|
||||
|
||||
export default preFilter;
|
||||
|
@ -1,8 +1,8 @@
|
||||
import isIE from "../var/isIE.js";
|
||||
import whitespace from "../var/whitespace.js";
|
||||
import support from "./support.js";
|
||||
import { isIE } from "../var/isIE.js";
|
||||
import { whitespace } from "../var/whitespace.js";
|
||||
import { support } from "./support.js";
|
||||
|
||||
var rbuggyQSA = [];
|
||||
export var rbuggyQSA = [];
|
||||
|
||||
if ( isIE ) {
|
||||
rbuggyQSA.push(
|
||||
@ -33,5 +33,3 @@ if ( !support.cssHas ) {
|
||||
}
|
||||
|
||||
rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join( "|" ) );
|
||||
|
||||
export default rbuggyQSA;
|
||||
|
@ -1,5 +1,3 @@
|
||||
function selectorError( msg ) {
|
||||
export function selectorError( msg ) {
|
||||
throw new Error( "Syntax error, unrecognized expression: " + msg );
|
||||
}
|
||||
|
||||
export default selectorError;
|
||||
|
@ -1,5 +1,5 @@
|
||||
import document from "../var/document.js";
|
||||
import support from "../var/support.js";
|
||||
import { document } from "../var/document.js";
|
||||
import { support } from "../var/support.js";
|
||||
|
||||
// Support: Chrome 105 - 111 only, Safari 15.4 - 16.3 only
|
||||
// Make sure the `:has()` argument is parsed unforgivingly.
|
||||
@ -17,4 +17,4 @@ try {
|
||||
support.cssHas = true;
|
||||
}
|
||||
|
||||
export default support;
|
||||
export { support };
|
||||
|
@ -3,8 +3,6 @@
|
||||
* @param {Element|Object=} context
|
||||
* @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value
|
||||
*/
|
||||
function testContext( context ) {
|
||||
export function testContext( context ) {
|
||||
return context && typeof context.getElementsByTagName !== "undefined" && context;
|
||||
}
|
||||
|
||||
export default testContext;
|
||||
|
@ -1,4 +1,4 @@
|
||||
function toSelector( tokens ) {
|
||||
export function toSelector( tokens ) {
|
||||
var i = 0,
|
||||
len = tokens.length,
|
||||
selector = "";
|
||||
@ -7,5 +7,3 @@ function toSelector( tokens ) {
|
||||
}
|
||||
return selector;
|
||||
}
|
||||
|
||||
export default toSelector;
|
||||
|
@ -1,14 +1,14 @@
|
||||
import jQuery from "../core.js";
|
||||
import rcomma from "./var/rcomma.js";
|
||||
import rleadingCombinator from "./var/rleadingCombinator.js";
|
||||
import rtrim from "../var/rtrim.js";
|
||||
import createCache from "./createCache.js";
|
||||
import selectorError from "./selectorError.js";
|
||||
import filterMatchExpr from "./filterMatchExpr.js";
|
||||
import { jQuery } from "../core.js";
|
||||
import { rcomma } from "./var/rcomma.js";
|
||||
import { rleadingCombinator } from "./var/rleadingCombinator.js";
|
||||
import { rtrim } from "../var/rtrim.js";
|
||||
import { createCache } from "./createCache.js";
|
||||
import { selectorError } from "./selectorError.js";
|
||||
import { filterMatchExpr } from "./filterMatchExpr.js";
|
||||
|
||||
var tokenCache = createCache();
|
||||
|
||||
function tokenize( selector, parseOnly ) {
|
||||
export function tokenize( selector, parseOnly ) {
|
||||
var matched, match, tokens, type,
|
||||
soFar, groups, preFilters,
|
||||
cached = tokenCache[ selector + " " ];
|
||||
@ -79,5 +79,3 @@ function tokenize( selector, parseOnly ) {
|
||||
// Cache the tokens
|
||||
tokenCache( selector, groups ).slice( 0 );
|
||||
}
|
||||
|
||||
export default tokenize;
|
||||
|
@ -1,6 +1,6 @@
|
||||
// CSS escapes
|
||||
// https://www.w3.org/TR/CSS21/syndata.html#escaped-characters
|
||||
import whitespace from "../var/whitespace.js";
|
||||
import { whitespace } from "../var/whitespace.js";
|
||||
|
||||
var runescape = new RegExp( "\\\\[\\da-fA-F]{1,6}" + whitespace +
|
||||
"?|\\\\([^\\r\\n\\f])", "g" ),
|
||||
@ -22,8 +22,6 @@ var runescape = new RegExp( "\\\\[\\da-fA-F]{1,6}" + whitespace +
|
||||
String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
|
||||
};
|
||||
|
||||
function unescapeSelector( sel ) {
|
||||
export function unescapeSelector( sel ) {
|
||||
return sel.replace( runescape, funescape );
|
||||
}
|
||||
|
||||
export default unescapeSelector;
|
||||
|
@ -1,8 +1,8 @@
|
||||
import jQuery from "../core.js";
|
||||
import document from "../var/document.js";
|
||||
import sort from "../var/sort.js";
|
||||
import splice from "../var/splice.js";
|
||||
import slice from "../var/slice.js";
|
||||
import { jQuery } from "../core.js";
|
||||
import { document } from "../var/document.js";
|
||||
import { sort } from "../var/sort.js";
|
||||
import { splice } from "../var/splice.js";
|
||||
import { slice } from "../var/slice.js";
|
||||
|
||||
var hasDuplicate;
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
import whitespace from "../../var/whitespace.js";
|
||||
import identifier from "./identifier.js";
|
||||
import { whitespace } from "../../var/whitespace.js";
|
||||
import { identifier } from "./identifier.js";
|
||||
|
||||
// Attribute selectors: https://www.w3.org/TR/selectors/#attribute-selectors
|
||||
export default "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace +
|
||||
export var attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace +
|
||||
|
||||
// Operator (capture 2)
|
||||
"*([*^$|!~]?=)" + whitespace +
|
||||
|
@ -1,2 +1,2 @@
|
||||
export default "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|" +
|
||||
"loop|multiple|open|readonly|required|scoped";
|
||||
export var booleans = "checked|selected|async|autofocus|autoplay|controls|" +
|
||||
"defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped";
|
||||
|
@ -1,5 +1,5 @@
|
||||
import whitespace from "../../var/whitespace.js";
|
||||
import { whitespace } from "../../var/whitespace.js";
|
||||
|
||||
// https://www.w3.org/TR/css-syntax-3/#ident-token-diagram
|
||||
export default "(?:\\\\[\\da-fA-F]{1,6}" + whitespace +
|
||||
export var identifier = "(?:\\\\[\\da-fA-F]{1,6}" + whitespace +
|
||||
"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+";
|
||||
|
@ -1,5 +1,5 @@
|
||||
import documentElement from "../../var/documentElement.js";
|
||||
import { documentElement } from "../../var/documentElement.js";
|
||||
|
||||
// Support: IE 9 - 11+
|
||||
// IE requires a prefix.
|
||||
export default documentElement.matches || documentElement.msMatchesSelector;
|
||||
export var matches = documentElement.matches || documentElement.msMatchesSelector;
|
||||
|
@ -1,7 +1,7 @@
|
||||
import identifier from "./identifier.js";
|
||||
import attributes from "./attributes.js";
|
||||
import { identifier } from "./identifier.js";
|
||||
import { attributes } from "./attributes.js";
|
||||
|
||||
export default ":(" + identifier + ")(?:\\((" +
|
||||
export var pseudos = ":(" + identifier + ")(?:\\((" +
|
||||
|
||||
// To reduce the number of selectors needing tokenize in the preFilter, prefer arguments:
|
||||
// 1. quoted (capture 3; capture 4 or capture 5)
|
||||
|
@ -1,3 +1,3 @@
|
||||
import whitespace from "../../var/whitespace.js";
|
||||
import { whitespace } from "../../var/whitespace.js";
|
||||
|
||||
export default new RegExp( "^" + whitespace + "*," + whitespace + "*" );
|
||||
export var rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" );
|
||||
|
@ -1,3 +1,3 @@
|
||||
import whitespace from "../../var/whitespace.js";
|
||||
import { whitespace } from "../../var/whitespace.js";
|
||||
|
||||
export default new RegExp( whitespace + "|>" );
|
||||
export var rdescend = new RegExp( whitespace + "|>" );
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user