@material/dom
Advanced tools
Comparing version 3.0.0-alpha.1 to 3.0.0
@@ -26,6 +26,15 @@ // Generated by dts-bundle v0.7.3 | ||
*/ | ||
import * as events from '@material/dom/events'; | ||
import * as ponyfill from '@material/dom/ponyfill'; | ||
export { ponyfill }; | ||
export { events, ponyfill }; | ||
} | ||
declare module '@material/dom/events' { | ||
/** | ||
* Determine whether the current browser supports passive event listeners, and | ||
* if so, use them. | ||
*/ | ||
export function applyPassive(globalObj?: Window, forceRefresh?: boolean): boolean | EventListenerOptions; | ||
} | ||
declare module '@material/dom/ponyfill' { | ||
@@ -32,0 +41,0 @@ /** |
@@ -51,5 +51,5 @@ /** | ||
__webpack_require__.p = ""; | ||
return __webpack_require__(__webpack_require__.s = 130); | ||
return __webpack_require__(__webpack_require__.s = 117); | ||
}({ | ||
130: function(module, exports, __webpack_require__) { | ||
117: function(module, exports, __webpack_require__) { | ||
"use strict"; | ||
@@ -68,2 +68,4 @@ var __importStar = this && this.__importStar || function(mod) { | ||
}); | ||
var events = __importStar(__webpack_require__(4)); | ||
exports.events = events; | ||
var ponyfill = __importStar(__webpack_require__(2)); | ||
@@ -96,2 +98,35 @@ exports.ponyfill = ponyfill; | ||
exports.matches = matches; | ||
}, | ||
4: function(module, exports, __webpack_require__) { | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
var supportsPassive_; | ||
function applyPassive(globalObj, forceRefresh) { | ||
if (globalObj === void 0) { | ||
globalObj = window; | ||
} | ||
if (forceRefresh === void 0) { | ||
forceRefresh = false; | ||
} | ||
if (supportsPassive_ === undefined || forceRefresh) { | ||
var isSupported_1 = false; | ||
try { | ||
globalObj.document.addEventListener("test", function() { | ||
return undefined; | ||
}, { | ||
get passive() { | ||
isSupported_1 = true; | ||
return isSupported_1; | ||
} | ||
}); | ||
} catch (e) {} | ||
supportsPassive_ = isSupported_1; | ||
} | ||
return supportsPassive_ ? { | ||
passive: true | ||
} : false; | ||
} | ||
exports.applyPassive = applyPassive; | ||
} | ||
@@ -98,0 +133,0 @@ }); |
@@ -8,3 +8,3 @@ /** | ||
*/ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.dom=t():(e.mdc=e.mdc||{},e.mdc.dom=t())}(this,function(){return function(e){function t(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var r={};return t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=130)}({130:function(e,t,r){"use strict";var n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});var o=n(r(2));t.ponyfill=o},2:function(e,t,r){"use strict";function n(e,t){if(e.closest)return e.closest(t);for(var r=e;r;){if(o(r,t))return r;r=r.parentElement}return null}function o(e,t){return(e.matches||e.webkitMatchesSelector||e.msMatchesSelector).call(e,t)}Object.defineProperty(t,"__esModule",{value:!0}),t.closest=n,t.matches=o}})}); | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.dom=t():(e.mdc=e.mdc||{},e.mdc.dom=t())}(this,function(){return function(e){function t(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var r={};return t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=117)}({117:function(e,t,r){"use strict";var n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});var o=n(r(4));t.events=o;var u=n(r(2));t.ponyfill=u},2:function(e,t,r){"use strict";function n(e,t){if(e.closest)return e.closest(t);for(var r=e;r;){if(o(r,t))return r;r=r.parentElement}return null}function o(e,t){return(e.matches||e.webkitMatchesSelector||e.msMatchesSelector).call(e,t)}Object.defineProperty(t,"__esModule",{value:!0}),t.closest=n,t.matches=o},4:function(e,t,r){"use strict";function n(e,t){if(void 0===e&&(e=window),void 0===t&&(t=!1),void 0===o||t){var r=!1;try{e.document.addEventListener("test",function(){},{get passive(){return r=!0}})}catch(e){}o=r}return!!o&&{passive:!0}}Object.defineProperty(t,"__esModule",{value:!0});var o;t.applyPassive=n}})}); | ||
//# sourceMappingURL=mdc.dom.min.js.map |
@@ -23,3 +23,4 @@ /** | ||
*/ | ||
import * as events from './events'; | ||
import * as ponyfill from './ponyfill'; | ||
export { ponyfill }; | ||
export { events, ponyfill }; |
@@ -23,4 +23,5 @@ /** | ||
*/ | ||
import * as events from './events'; | ||
import * as ponyfill from './ponyfill'; | ||
export { ponyfill }; | ||
export { events, ponyfill }; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@material/dom", | ||
"description": "DOM manipulation utilities for Material Components for the web", | ||
"version": "3.0.0-alpha.1", | ||
"version": "3.0.0", | ||
"license": "MIT", | ||
@@ -20,3 +20,3 @@ "main": "dist/mdc.dom.js", | ||
}, | ||
"gitHead": "dae97b98c21bb93075a9688cf1f9076a4fe5a85d" | ||
"gitHead": "747f6ed544e3a3bb3fde71ceaa51359f2212bfb9" | ||
} |
@@ -37,1 +37,11 @@ <!--docs: | ||
`matches(element: Element, selector: string) => boolean` | Returns true if the given element matches the given CSS selector. | ||
### Event Functions | ||
External frameworks and libraries can use the following event utility methods. | ||
Method Signature | Description | ||
--- | --- | ||
`util.applyPassive(globalObj = window, forceRefresh = false) => object` | Determine whether the current browser supports passive event listeners | ||
> _NOTE_: The function `util.applyPassive` cache its results; `forceRefresh` will force recomputation, but is used mainly for testing and should not be necessary in normal use. |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
64778
18
388
1
47
1